feat(tui): replace rollback with session forks#30504
Open
fcoury-oai wants to merge 1 commit into
Open
Conversation
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
thread/rollbackis deprecated, but the TUI still used it for transcript time travel and for restoring a prompt when a turn was interrupted before visible model output. The warning suppression in #30124 was only a compatibility bridge: destructive rollback still rewrote the source thread and coupled two different interactions to an API that is going away.This change moves transcript time travel to inclusive session forks and restores interruption to normal transcript semantics: preserve what the user submitted, show that the turn was interrupted, and leave a fresh composer.
What Changed
thread/forkthrough the selected completed turn.Turn.isForkablemetadata so the TUI only offers persisted canonical turn boundaries; legacy synthetic history remains visible but is never sent aslastTurnId.TurnStartedand the transcript-only user item across very early interruption, while keeping an interrupted or hook-blocked prompt out of model-visible history.turn/startcannot leave a ghost transcript row.The deprecated app-server
thread/rollbackendpoint remains available for other clients; this PR removes its TUI consumers.How to Test
just codexfromcodex-rsand complete at least two turns.Ctrl+T, pressEscto enter fork selection, move to an older completed turn, and pressEnter.EscorCtrl+Cbefore any assistant output.Focused regression coverage:
just test -p codex-tui safety_bufferjust test -p codex-core interrupting_regular_turn_waiting_on_startup_prewarm_persists_user_itemjust test -p codex-app-server thread_shell_command_history_responses_exclude_persisted_command_executionsjust test -p codex-app-server-protocolThe protocol suite passed 251/251. Full affected-crate runs left only known local-environment failures: two Guardian tests that also fail on the unchanged base, three app-server tests requiring unavailable local binaries, and four core tests dependent on sandbox/MCP environment state.