Repository navigation
Conversation
Quitting during a running turn saved nothing from that turn, so a new conversation lost its prompt and partial answer. Next now stops the worker, waits up to 2 seconds and saves what it holds. Deltas still queued after a cancel restarted the turn on screen, so further Ctrl+C presses cancelled again instead of reaching the exit sequence. Next now ignores them until the runtime settles, which also makes a cancelled flood cheaper to drain. Adds a tmux case that sends a real burst through the client and query loop, and corrects the docs on how Ctrl+D exits and what is saved. Classic is unchanged. Refs #408
2 of 8 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 4, 2026
…st/408-event-flood
The running turn's messages reach the saved session only after its worker finishes. If it has not stopped within the 2 second wait, it is aborted first, and only the prompt from that turn is saved. Refs #408
Nothing checked the 2 second wait itself: the unit test passes its own short wait and the terminal case allowed 30 seconds. The case now quits while a Bash sleep ignores the stop and requires the exit within 8 seconds, with the prompt saved. Raising the wait to 20 seconds makes it fail. Refs #408
FLOOD_QUIT_TENTHS counted passes of a loop that also runs tmux, so it read a slow exit as faster than it was. The bounded quit check now says what it bounds: an exit within 8 s, from above only.
…st/408-event-flood
The timer started after the pause that follows the last key, so an exit just over 8 s measured under it.
This branch was successfully deployed
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.
Summary
Sends a real flood of text deltas through the real client and query loop, and fixes the two problems it found in Next. Classic's behaviour is unchanged.
The second fix also makes a cancelled flood much cheaper (release build, Next, one host, 120x40, 1,000,000 deltas, 2 runs each):
b3c952fTwo runs are too few to read anything into the Escape difference, and these rates are far beyond any real provider.
Context
deltas_still_queued_when_a_turn_is_cancelled_cannot_restart_itpins Classic's late-delta handling, and a probe confirmed that quitting Classic mid-turn still saves nothing.Behaviour to check
sleepdid not react to cancellation: exit took about 2.3 s against 0.3 s on main, and only the prompt was saved. The worker copies the turn's messages back only when it finishes, and it was stopped after the 2 s wait, so anything that turn had delivered would have been lost too. The tool did not finish after quit, on either build.Docs
docs/keybindings.mdsaid one Ctrl+D exits and that it signals EOF when the prompt has content. It takes two presses within 2 seconds, and it does nothing while the prompt has content.docs/commands.mdsaid unsaved state is flushed on exit, which wasn't true of a running turn. It now says what each renderer does, including what is saved when a Next turn does not stop within 2 seconds.Validation
deltas_still_queued_when_a_turn_is_cancelled_cannot_restart_it, and the two "keeps the prompt" and "keeps the partial answer" checks, failed before their fixes.scripts/tui-tests/run.sh event_flood: 19 passed, 0 failed, at the review head. At8f41e75: 25 passed, 0 failed, including the bounded quit; with the wait raised to 20 s, that check fails (the exit took about 18 s by the wall clock).cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings.cargo test --workspace --locked: 2916 passed, 0 failed, at the review head. At9e6c8a6, which merges test(tui-tests): run approval edges through real engine-local tools #449's new head and somain(Rust 1.99.1): 2915 passed, 0 failed, 52 ignored, with fmt, clippy,engine_contract,slash_command_registry,keybindings_goldenandclassic_baselinespassing.10b3b48changes only the terminal case.git diff --checkis clean.Landing review (2026-11-06)
A second review read
9ab7a49and found no blockers.docs/commands.mdsaid a running Next turn's output so far is saved on quit, which is false when the turn has not stopped within 2 s (its messages are copied back only when the worker finishes); the body gave the wrong cause for thesleepprobe9e6c8a6; body corrected above10b3b48: the case quits while a Bashsleepignores the stop and requires the exit within 8 s and the prompt saved. Raising the wait to 20 s makes it fail3c6cf12merges #449's new head.A re-review read
10b3b48. The first two findings are resolved, and the gap stays a follow-up. It added one nit: the case counted wait passes, each with a tmux call, as tenths of a second, and called an upper bound "waits about 2 s". Fixed in1651d86: the exit is timed by the wall clock, and the check says it bounds the exit within 8 s from above; the partial-answer check after a burst is what fails if the wait goes away.8f41e75merges #449's new head. A check of1651d86found the timer started after the pause that follows the last key, so an exit just over 8 s could pass; fixed inda2721d, which starts it at the last key. Atda2721dthe case passes 25 of 25, and the exit while a tool ignores the stop reads about 2 s.Not tested: Windows, Linux, or a real provider. On a fast release build a 300,000-delta burst can settle before the later Ctrl+C presses, so that part of the case only has teeth on a debug build, which is what
tui-tests.ymlruns. The unit test covers the same logic on any build.