Skip to content

feat(framework): show tool call cwd on Braintrust tool spans - #374

Merged
Coly010 merged 1 commit into
mainfrom
columferry/braintrust-tool-span-cwd
Oct 7, 2026
Merged

Coly010 merged 1 commit into
mainfrom
columferry/braintrust-tool-span-cwd

Conversation

@Coly010

@Coly010 Coly010 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

#356 records the working directory of each tool call on ToolCallRecord, but it stops there. The Braintrust upload builds tool spans from transcript parts, which carry no cwd, so a trace can't show which project a supabase start or supabase stop ran in. This was requested in the #356 review.

Expected Behavior

Tool-call transcript parts carry an optional cwd, copied from the event's tool.cwd in adaptTranscript. The upload's transcript schema accepts it and tool spans log it as metadata.cwd next to tool_name. The key is left off when the agent didn't record a directory. Results written before this change still parse.

Test plan

  • adaptTranscript sets cwd on the transcript part only when the event has tool.cwd
  • Transcript schema parses parts with and without cwd
  • logTranscript puts cwd in tool span metadata when present and omits it otherwise
  • pnpm format:check, pnpm typecheck
  • core, framework, sandbox, web tests and test:cli-lib
  • pnpm check end to end (the judge smoke step needs a provider key)

🤖 Generated with Claude Code

@Coly010
Coly010 requested a review from a team as a code owner October 7, 2026 11:51
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Oct 7, 2026 11:51am UTC

Request Review

@Coly010 Coly010 self-assigned this Oct 7, 2026

@Rodriguespn Rodriguespn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirm I can see the cwd in the eval metadata (BT trace).

Image

Approving this. Thanks @Coly010 🙌

@Coly010
Coly010 merged commit 2e7f208 into main Oct 7, 2026
6 checks passed
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.

2 participants