Skip to content

fix(weave): prevent Claude async turn misattribution - #7697

Open
rgao-coreweave wants to merge 2 commits into
masterfrom
codex/fix-claude-agent-sdk-delayed-async-prompt
Open

fix(weave): prevent Claude async turn misattribution#7697
rgao-coreweave wants to merge 2 commits into
masterfrom
codex/fix-claude-agent-sdk-delayed-async-prompt

Conversation

@rgao-coreweave

@rgao-coreweave rgao-coreweave commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevent promptless turns when system/init precedes a delayed async prompt.
  • Defer only bootstrap init messages, keeping late background-task output out of the next turn.
  • Add regressions for delayed init, transport failure, and stale task output.

Follow-up to #7665 and its review thread.

Validation

  • Claude Agent SDK shard: 44 passed
  • Ruff check and format: passed
Scenario master This PR
Delayed prompt Mispaired turns Correctly paired turns
Late task output Attributed to next turn Excluded from next turn

Breaking changes

None.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../integrations/claude_agent_sdk/otel_integration.py 85.71% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@rgao-coreweave
rgao-coreweave force-pushed the codex/fix-claude-agent-sdk-delayed-async-prompt branch from a265c53 to bb8b793 Compare August 6, 2026 06:24
@rgao-coreweave rgao-coreweave changed the title fix(weave): defer Claude turns until async input arrives fix(weave): trace delayed Claude async prompts Aug 6, 2026
@rgao-coreweave
rgao-coreweave marked this pull request as ready for review August 6, 2026 16:02
@rgao-coreweave
rgao-coreweave requested a review from a team as a code owner August 6, 2026 16:02
@rgao-coreweave
rgao-coreweave requested a review from a team August 6, 2026 16:02

@ro31337 ro31337 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.

Approving with a caveat to think about the corner case here, maybe improve here, or follow-up, or ignore if it's not relevant. Other changes look good

Comment thread weave/integrations/claude_agent_sdk/otel_integration.py Outdated
@w-b-hivemind

w-b-hivemind Bot commented Aug 6, 2026

Copy link
Copy Markdown

HiveMind Sessions

1 session · 18m · $12

Session Agent Duration Tokens Cost Lines
Github Pr Comments Review And Explanation
019fd86c-7159-7fd1-85a1-deeb92f94a27
codex 18m 324.8K $12 +0 -0
Total 18m 324.8K $12 +0 -0

View all sessions in HiveMind →

Run codex resume 019fd86c-7159-7fd1-85a1-deeb92f94a27 to pickup where you left off.

@rgao-coreweave rgao-coreweave changed the title fix(weave): trace delayed Claude async prompts fix(weave): prevent Claude async turn misattribution Aug 6, 2026
@rgao-coreweave
rgao-coreweave enabled auto-merge (squash) August 6, 2026 19:51
@rgao-coreweave
rgao-coreweave disabled auto-merge August 6, 2026 20:30
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