Skip to content

fix: keep idle Claude answers and server-terminal input intact - #419

Open
cursor[bot] wants to merge 2 commits into
mainfrom
fix/idle-answer-and-server-terminal-input
Open

cursor[bot] wants to merge 2 commits into
mainfrom
fix/idle-answer-and-server-terminal-input

Conversation

@cursor

@cursor cursor Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

What Changed

Two fixes:

  • After a Claude turn ends, drop the assistant message id. An idle task answer that arrives with no new message_start is stored under the turn, and a later idle answer does not reuse an id the previous one claimed.
  • Re-admitting the server terminal keeps its input session open. A successful admission of nothing is no longer treated as a failed admission.

Why

Claude Code 2.1.326 answers a background task that finishes while no turn is running with a text delta and no message_start. The previous turn left its provider message id set, and the projection appends a streaming delta onto the row with that id, so the task answer rewrote the previous assistant message.

The server terminal has no workspace. Re-admission (a lagged orchestration broadcast, or a terminal.beginInput that races any other workspace change) therefore succeeds with no admission. That None was passed to the seal path, which closed the keyboard until input was attached again.

UI Changes

No new UI. The existing chat transcript stops merging a later task answer into the previous message, and the server terminal keeps accepting keystrokes after a re-admission.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

No screenshots or video: both fixes are server behavior covered by tests.

Validation: cargo test -p bibcode-server --lib -- follow_up_turn_tests (15 passed, including an_idle_answer_does_not_extend_the_previous_assistant_message), cargo test -p bibcode-server --lib -- a_server_terminal_readmission_keeps_keyboard_input (passed), a_changed_workspace_that_cannot_be_admitted_seals_input and a_workspace_change_while_input_begins_is_readmitted (passed), cargo fmt --all -- --check, and cargo clippy -p bibcode-server --lib --no-deps -- -D warnings. vp check and vp run typecheck were not run: this checkout has no node_modules and vp is not on PATH.

Open in Web View Automation 

cursoragent and others added 2 commits November 23, 2026 12:54
A delivered turn left its assistant message id set. Claude Code 2.1.326
then answers a finished background task with a text delta and no new
message_start, so the projection appended that answer onto the previous
message. Drop the id when the turn or the idle answer ends.

Co-authored-by: mubeda <mubeda@users.noreply.github.com>
The server terminal has no workspace, so re-admission succeeds with no
admission. That None was passed to the seal path and closed the keyboard.

Co-authored-by: mubeda <mubeda@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant