Repository navigation
Refuse Side chat replies inside a running turn instead of forking an older checkpoint - #6514
Merged
Merged
Conversation
…older checkpoint An anchored fork inside an unfinished turn threw the same fork_source_session_unavailable code as the cases Side chat may answer with a tip fork. Side chat retried without the anchor, and while a turn runs the tip is the previous completed checkpoint, so the reply silently lost the selected turn's context. The running-turn case now has its own fork_source_turn_incomplete code; Side chat surfaces it as an error toast. Fixes #6497 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
An anchored fork inside a turn that has not completed is refused by core with
fork_source_session_unavailable, the same code core uses for refusals where Side chat may fall back to a tip fork (for example, an earlier message on a tip-only provider). Side chat caught that code and retried withoutsourceSeqEnd. While a turn is running, the tip is the previous completed turn's checkpoint, so the reply opened successfully with the quote but silently lacked the selected turn's context. See the issue's reproduction report.What changed
apps/server/src/services/threads/thread-fork-history.ts: the "turn containing it has not completed" refusal now uses its own code,fork_source_turn_incomplete(same HTTP 400 and message). Every other anchored refusal keepsfork_source_session_unavailable.fork_source_session_unavailable, so a running-turn reply now surfaces the server error through the existing "Failed to start side chat" toast, matching core's Fork action, instead of forking an older checkpoint. Fallback cases such as tip-only providers are unchanged.--source-seq-endanchors on a completed turn.How you verified
apps/server/test/public/public-thread-fork.test.ts: installs the real built-in Side chat plugin, callscreateSideChaton an agent message inside a running turn, and asserts it fails without queuing a fork. It then completes the turn and asserts the same request forks at that turn's checkpoint. With the server change reverted, it fails withexpected 200 not to be 200(the bug).pnpm exec turbo run test typecheck --filter=@bb/server --filter=bb-plugin-side-chat: 361 server test files passed, Side chat tests passed.pnpm start:worktreeserver with real Codex threads: replying to commentary inside a held-open turn was refused with "the turn containing it has not completed"; replying to the same message after the turn completed opened a side chat that correctly recalled the code introduced in that turn.Fixes #6497
🤖 Generated with Claude Code