Repository navigation
Conversation
🦋 Changeset detectedLatest commit: d79dd9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
hary73
force-pushed
the
haryahuja/age-2837-add-tfgthread_id-to-metadata-in-model
branch
2 times, most recently
from
November 16, 2026 07:47
bfe6224 to
cfb7154
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
hary73
force-pushed
the
haryahuja/age-2837-add-tfgthread_id-to-metadata-in-model
branch
from
November 16, 2026 07:48
cfb7154 to
d79dd9a
Compare
hary73
marked this pull request as ready for review
November 16, 2026 07:49
hary73
requested review from
chiragjn,
debajyoti-truefoundry,
heerambavi1998 and
thesujai
as code owners
November 16, 2026 07:49
PR overviewNo security issues were found in this pull request. Reviews
|
4 of 5 tasks
heerambavi1998
approved these changes
Nov 16, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gateway traces carry the session, turn and agent IDs in
x-tfy-metadata, but nothing identifies which thread made a call, so a subagent's calls can't be told apart from the root's. This tags every model call withtfg.thread_id. It's the groundwork for subagent model routing (PR #1390), where a routing decision is joined to the calls the subagent made.Linear: AGE-2837
Changes
AgentThreadpasses{ 'tfg.thread_id': threadId }as per-call metadata on its model call.buildOutboundRequestHeadersalready folds per-call metadata intox-tfy-metadatafor TrueFoundry providers and ignores it for others.tfg.thread_idtoo, from the execution context it already receives, next totfg.compaction.main, so a separate parent thread ID would add nothing.How was this tested?
x-tfy-metadatais already covered bybuildOutboundRequestHeaders.test.ts.trueforge-core: typecheck and the full test suite pass. ESLint and Prettier are clean on the changed files.Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locally (onlytrueforge-coretypecheck and tests, plus lint and format on the changed files, were run).env.exampleupdated if configuration or behavior changed (n/a)Made with Cursor
Note
Low Risk
Small additive metadata on existing LLM call paths; header folding is already tested and behavior is unchanged for non–TrueFoundry providers.
Reviewed by Cursor Bugbot for commit d79dd9a. Bugbot is set up for automated code reviews on this repo. Configure here.