Skip to content

feat: fine-grained tool streaming via TFY beta header - #1088

Merged
chiragjn merged 5 commits into
mainfrom
cursor/tfy-fine-grained-tool-streaming-header
Oct 19, 2026
Merged

chiragjn merged 5 commits into
mainfrom
cursor/tfy-fine-grained-tool-streaming-header

Conversation

@chiragjn

@chiragjn chiragjn commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • For truefoundry, send anthropic_beta: fine-grained-tool-streaming-2025-05-14 on outbound model requests instead of mutating tool defs with eager_input_streaming (safer rollout; feat: pass eager_input_streaming on TrueFoundry chat tools #1071 remains the tool-def approach)
  • For native anthropic, pin call-level toolStreaming: true so tools get fine-grained input streaming on the Anthropic wire

Test plan

  • Unit: truefoundry-only anthropic_beta header on compatible client
  • Unit: anthropic buildProviderOptions includes toolStreaming: true
  • Manual: TFY Anthropic chat with tools streams argument deltas under the beta header

Made with Cursor


Note

Medium Risk
Changes outbound LLM headers/provider options and tool-call argument handling on the agent execution path; parse failures are isolated but behavior for malformed args differs from prior implicit JSON.parse throws.

Reviewed by Cursor Bugbot for commit e3e7090. Bugbot is set up for automated code reviews on this repo. Configure here.

TrueFoundry uses anthropic_beta instead of mutating tool defs; native
Anthropic keeps call-level toolStreaming.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e3e7090

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-core Patch
@truefoundry/trueforge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1979e22. Configure here.

Comment thread packages/trueforge-core/src/core/llm/VercelAILLM.ts Outdated
chiragjn and others added 4 commits October 19, 2026 09:17
Co-authored-by: Cursor <cursoragent@cursor.com>
Match Anthropic's wire header spelling instead of anthropic_beta.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Fine-grained streaming can leave incomplete arguments; surface parse_error
without echoing the raw payload.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chiragjn
chiragjn merged commit 248e768 into main Oct 19, 2026
15 checks passed
@chiragjn
chiragjn deleted the cursor/tfy-fine-grained-tool-streaming-header branch October 19, 2026 04:15
cursor Bot pushed a commit that referenced this pull request Oct 19, 2026
* feat: fine-grained tool streaming via TFY beta header

TrueFoundry uses anthropic_beta instead of mutating tool defs; native
Anthropic keeps call-level toolStreaming.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: inline TFY fine-grained tool streaming beta string

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: use anthropic-beta header name for TFY tool streaming

Match Anthropic's wire header spelling instead of anthropic_beta.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: drop TFY beta header unit test; note deprecation

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat: report invalid tool-arg JSON as a distinct parse error

Fine-grained streaming can leave incomplete arguments; surface parse_error
without echoing the raw payload.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 248e768)
cursor Bot pushed a commit that referenced this pull request Oct 19, 2026
* feat: fine-grained tool streaming via TFY beta header

TrueFoundry uses anthropic_beta instead of mutating tool defs; native
Anthropic keeps call-level toolStreaming.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: inline TFY fine-grained tool streaming beta string

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: use anthropic-beta header name for TFY tool streaming

Match Anthropic's wire header spelling instead of anthropic_beta.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: drop TFY beta header unit test; note deprecation

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat: report invalid tool-arg JSON as a distinct parse error

Fine-grained streaming can leave incomplete arguments; surface parse_error
without echoing the raw payload.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 248e768)
truefoundry-saas added a commit that referenced this pull request Oct 19, 2026
* cherry-pick (needs manual conflict resolution)

* chore: Add PostHog envs in Dockerfile, add trueforge prefix and include tenant id (#1036)

* chore: accept PostHog Vite build args in Dockerfile

Allow SaaS image builds to bake in analytics via --build-arg without affecting default OSS images.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: update analytics event names to include 'trueforge' namespace

* refactor: enhance analytics tracking with tenant ID and update session state structure

* feat: prefix AnalyticsEvents names with 'trueforge.' for better event namespacing

* refactor: simplify SessionState type definition for clarity

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 7f2be59)

* Wire posthog creds during build (#1059)

* Wire posthog creds during build

* nit: env ordering

(cherry picked from commit 69f0990)

* refactor: remove reasoning effort validation from agent spec (#1067)

* refactor: remove reasoning effort validation from agent spec

* refactor: simplify reasoning effort validation logic in agent spec

* chore: add changeset for relaxed reasoning effort validation

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit b037c92)

* feat: fine-grained tool streaming via TFY beta header (#1088)

* feat: fine-grained tool streaming via TFY beta header

TrueFoundry uses anthropic_beta instead of mutating tool defs; native
Anthropic keeps call-level toolStreaming.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: inline TFY fine-grained tool streaming beta string

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: use anthropic-beta header name for TFY tool streaming

Match Anthropic's wire header spelling instead of anthropic_beta.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: drop TFY beta header unit test; note deprecation

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat: report invalid tool-arg JSON as a distinct parse error

Fine-grained streaming can leave incomplete arguments; surface parse_error
without echoing the raw payload.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 248e768)

* Regenerate OpenAPI document and SDKs

---------

Co-authored-by: harshil-2096 <100749155+harshil-2096@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Chirag Jain <jain.chirag925@gmail.com>
Co-authored-by: Sujai Kumar Gupta <120925871+thesujai@users.noreply.github.com>
Co-authored-by: trueforge-dev-bot[bot] <trueforge-dev-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant