fix(claude): separate reasoning summary parts in streamed thinking - #944
fix(claude): separate reasoning summary parts in streamed thinking#944DevMello wants to merge 2 commits into
Conversation
The streaming translator folded every summary part into one thinking block with no separator, so multi-part summaries rendered as run-on text. The JSON path already joins parts with a blank line; the stream now emits the same separator at part boundaries.
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesReasoning stream handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/claude-outbound.test.ts`:
- Around line 242-260: Add coverage in the “same-part deltas and index-free
reasoning frames never get a separator” test for indexed reasoning content by
emitting deltas with content_index 0 and 1. Collect the converted message and
assert its thinking content contains the two parts separated by "\n\n",
exercising the content_index branch while preserving the existing same-part and
index-free assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8b37aca0-694d-480d-a5f3-7c2226c9e0ff
📒 Files selected for processing (2)
src/claude/outbound.tstests/claude-outbound.test.ts
|
Carried onto the review stack as #953 (stack 3/3), unmodified. Your commits were taken with Verified on the stack: This PR stays open until #953 lands. If a maintainer prefers to take yours directly instead, that path is unaffected — the stack commits get dropped and this one merges. Once #953 merges I'll close this as carried, with the credit already in the commit history rather than in a comment. Stack: #951 (plan, base Thanks for the fix. |
|
Leave it as draft. Thanks. It doesnt need any more changes as you can see in juns comment on which you didn't respond to. |
Summary
On the native ChatGPT backend the upstream Responses stream is translated straight into Anthropic SSE. Reasoning summaries arrive there in parts, each its own paragraph with a bold headline. The streaming translator folded every part into one thinking block with no separator, so thinking text rendered as run-on lines like "wants X.Planning the fix". The non-streaming translator in the same file already joins parts with a blank line. The stream now tracks part identity on the delta frames and emits the same blank-line separator at part boundaries. Frames without part indices keep a constant key and behave as before, and a new reasoning item still opens its own block.
Verification
tests/claude-outbound.test.ts: multi-part summaries match the JSON path's joined text, and same-part or index-free deltas never get a separator.bun run test,typecheck,lint:gui,privacy:scan.Checklist
Summary by CodeRabbit
Bug Fixes
Tests