Repository navigation
Keep each reply's live reasoning apart in every SDK - #1051
Merged
Merged
Conversation
LiveReasoning looked a step up by its id alone, and every reply numbers its steps from r1, so a later reply's live thinking was dropped when its round was shorter than an earlier reply's, or ran on after it when longer. A step is now read by its reply and its id in the Swift, JS, Kotlin and Dart SDKs, and the demos read it that way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-reasoning-per-reply
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The router names a reply's reasoning steps
r1,r2, ... per reply, so every reply has anr1.LiveReasoninglooked a step up by its id alone, so a later reply's live thinking mixed with an earlier reply's. When its round was shorter than the earlier one's, it was dropped as already held. When it was longer, it was joined onto the earlier text. Either way, the earlier reply's thinking showed in the later reply's step.Changes
LiveReasoning:reasoning[message: message.id, step: step.id]reasoning.get(message.id, step.id)reasoning[message.id, step.id], andaddtakes the message id before the step idreasoning[(message: message.id, step: step.id)]readtakes the message id from the message it reads, so apps that only callreadchange only their lookups.sdkandsdk-swiftskills, and the changelog.🤖 Generated with Claude Code