Conversation
🦋 Changeset detectedLatest commit: 4ca683d The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for your contribution! We require all external PRs to be opened in draft status first so you can address CodeRabbit review comments and ensure CI passes before requesting a review. Please re-open this PR as a draft. See CONTRIBUTING.md for details. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| private assertTranscriptReady(chatId: string, state: ChatSessionState): void { | ||
| if (!state.requiresTranscriptReload) return; | ||
| this.coordinator?.release(chatId); | ||
| throw new Error( | ||
| "Stopped chat response cannot be matched. Reload the chat before sending another message." | ||
| ); |
There was a problem hiding this comment.
🔴 Transcript reload leaves chat blocked
After requiresTranscriptReload is set, seedResumeCursor leaves it and the stopped boundary intact. Reloaded chats still reject every send and reconnect.
Learn more
The transport sets requiresTranscriptReload after the server accepts a successor without returning its input sequence. The public transcript-loading flow calls seedResumeCursor, which neither advances an existing cursor nor clears this flag or the supersede gate. assertTranscriptReady therefore keeps rejecting sends after the requested reload, and reconnectToStream also keeps returning null.
Example: A stopped chat accepts message B without a sequence, so message B throws the reload error. useLoadTranscript then loads a snapshot through B and calls seedResumeCursor(chatId, "20"). The session still has requiresTranscriptReload: true; sending message C throws the same error instead of continuing from event 20.
Recommended fix: Add an explicit transcript-reload operation that force-applies the loaded output cursor and clears requiresTranscriptReload, skipToTurnComplete, supersededInputSeq, and stale active-turn state. Make useLoadTranscript use that operation only after a successful fresh transcript load.
Was this helpful? React with 👍 or 👎 to provide feedback.
Stop acknowledgments can close a later response, and lost Stop state can replay old tool output after a reload.
The SDK now records Stop before the request, retains its boundary through hydration, and requires transcript reload for accepted responses without sequence correlation.
Checklist
Testing
RedisCacheStoreConfig, in unchangedinternal-packages/cache/src/stores/redis.ts:7Changelog
New chat responses remain intact after Stop, including slow acknowledgments and page reloads.
Risk