Skip to content

fix(claude-agent-sdk): preserve parallel tool span outputs - #1053

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/fix-tool-span-outputs-820dc5e5
Nov 3, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/fix-tool-span-outputs-820dc5e5

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

🤖 This text was AI-generated.

Claude can return a tool result while sibling tool calls from the same provider response are still streaming. Cleanup previously ran before checking the provider message ID, closing siblings with an earlier end time and discarding their eventual outputs:

tool a -> result a -> tool b -> tool c
                              cleanup closes b before its start

Move cleanup after the same-response merge path so active sibling tools remain open until their results arrive:

same provider response -> merge and keep tools open
new provider response  -> clean up dangling tools

Consolidate back-to-back and interleaved result coverage in a parametrized regression using real transport recordings for both supported versions.

resolves https://linear.app/braintrustdata/issue/SDK-568/claude-agent-sdk-integration-python-drops-tool-span-outputs-during

> 🤖 **This text was AI-generated.**

Claude can return a tool result while sibling tool calls from the same
provider response are still streaming. Cleanup previously ran before
checking the provider message ID, closing siblings with an earlier end
time and discarding their eventual outputs:

```text
tool a -> result a -> tool b -> tool c
                              cleanup closes b before its start
```

Move cleanup after the same-response merge path so active sibling tools
remain open until their results arrive:

```text
same provider response -> merge and keep tools open
new provider response  -> clean up dangling tools
```

Consolidate back-to-back and interleaved result coverage in a parametrized
regression using real transport recordings for both supported versions.

Fixes: SDK-568
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T03:56:57.390376Z a9b0692 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit f93eec4 into main Nov 3, 2026
98 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/fix-tool-span-outputs-820dc5e5 branch November 3, 2026 16:45
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