fix(tui): preserve early interrupted prompts in transcripts#31933
Open
fcoury-oai wants to merge 3 commits into
Open
fix(tui): preserve early interrupted prompts in transcripts#31933fcoury-oai wants to merge 3 commits into
fcoury-oai wants to merge 3 commits into
Conversation
This was referenced Jul 9, 2026
dc9d047 to
d46fb69
Compare
da29e29 to
6d58af4
Compare
ae4ed6a to
2dc3f1f
Compare
2dc3f1f to
dfe9710
Compare
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
An immediately interrupted prompt must still become a durable transcript event. Before this change, Ctrl+C could arrive while the turn was still starting, so the TUI treated Codex as idle and quit. If interruption arrived slightly later but before model output, the TUI used
thread/rollbackto remove the prompt and restore it into the composer. Both paths make a submitted user message disappear instead of recording that it was interrupted.This change gives early interruption the same durable meaning regardless of timing: keep the submitted prompt in the transcript, append the interruption marker, and open a blank composer for the next message. It also removes the TUI's final rollback consumer; the app-server endpoint remains available for other clients.
What Changed
TurnStartedand the transcript user item are each emitted exactly once.thread/rollbackrouting machinery.How to Test
codex fork <thread-id>.Esctwice, select the last prompt, and press Enter to branch the conversation with that prompt restored in the composer.Focused coverage:
just test -p codex-core interrupting_regular_turn_waiting_on_startup_prewarm_persists_user_item- passedjust test -p codex-core interrupt_during_user_prompt_submit_hook_persists_one_transcript_item- passedjust test -p codex-tui output_free- 2 passedjust test -p codex-tui ctrl_c_interrupts_turn_pending_start- passedjust test -p codex-tui- 2,976 passed; the two failures are the existing Guardian feature-flag tests also present in the lower stack layersjust fixpassed forcodex-analytics,codex-core,codex-exec, andcodex-tui;just fmtpassedThe broad
codex-corerun reached environment-only failures because the shared target directory does not containtest_stdio_server; the two new core regressions pass independently. The full argument-comment lint is blocked locally by the Bazel LLVMcompiler-rtpackage, and the prebuilt crate-scoped runner is pinned to Rust 1.92 whilesqlx 0.9requires Rust 1.94. The touched Rust diff was manually audited for exact positional-literal comments.Stack