Skip to content

Handle Claude Code background result sequences - #186

Merged
Qian-Cheng-nju merged 1 commit into
mainfrom
fix/claude-multiple-result-events
Oct 9, 2026
Merged

Qian-Cheng-nju merged 1 commit into
mainfrom
fix/claude-multiple-result-events

Conversation

@Qian-Cheng-nju

@Qian-Cheng-nju Qian-Cheng-nju commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Claude Code can emit several indexed results as background tasks finish. The parser previously rejected these streams, dropping reported cost and marking tool counts incomplete. Validate the session and result sequence, read cumulative cost/model totals once, and aggregate turn-local usage without double counting.

Preserve lower bounds for malformed streams, mixed sessions, incomplete tails, contradictory totals, and missing request evidence. Empty background notifications retain accumulated API duration. Legacy token totals and tool enumeration use the same stream interpretation.

@Qian-Cheng-nju
Qian-Cheng-nju marked this pull request as ready for review October 9, 2026 06:01
@Qian-Cheng-nju
Qian-Cheng-nju merged commit 41425fa into main Oct 9, 2026
1 check 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.

1 participant