core-agent-ide/codex-rs/tui/src
Owen Lin 8b7ec31ba7
feat(app-server): thread/rollback API (#8454)
Add `thread/rollback` to app-server to support IDEs undo-ing the last N
turns of a thread.

For context, an IDE partner will be supporting an "undo" capability
where the IDE (the app-server client) will be responsible for reverting
the local changes made during the last turn. To support this well, we
also need a way to drop the last turn (or more generally, the last N
turns) from the agent's context. This is what `thread/rollback` does.

**Core idea**: A Thread rollback is represented as a persisted event
message (EventMsg::ThreadRollback) in the rollout JSONL file, not by
rewriting history. On resume, both the model's context (core replay) and
the UI turn list (app-server v2's thread history builder) apply these
markers so the pruned history is consistent across live conversations
and `thread/resume`.

Implementation notes:
- Rollback only affects agent context and appends to the rollout file;
clients are responsible for reverting files on disk.
- If a thread rollback is currently in progress, subsequent
`thread/rollback` calls are rejected.
- Because we use `CodexConversation::submit` and codex core tracks
active turns, returning an error on concurrent rollbacks is communicated
via an `EventMsg::Error` with a new variant
`CodexErrorInfo::ThreadRollbackFailed`. app-server watches for that and
sends the BAD_REQUEST RPC response.

Tests cover thread rollbacks in both core and app-server, including when
`num_turns` > existing turns (which clears all turns).

**Note**: this explicitly does **not** behave like `/undo` which we just
removed from the CLI, which does the opposite of what `thread/rollback`
does. `/undo` reverts local changes via ghost commits/snapshots and does
not modify the agent's context / conversation history.
2026-01-06 21:23:48 +00:00
..
bin replace tui_markdown with a custom markdown renderer (#3396) 2025-09-10 12:13:53 -07:00
bottom_pane suppress popups while browsing input history (#8772) 2026-01-06 11:13:21 -08:00
chatwidget chore: clear background terminals on interrupt (#8786) 2026-01-06 19:01:07 +00:00
exec_cell Slightly better status display for unified exec (#7563) 2025-12-04 08:32:54 -08:00
notifications Fix toasts on Windows under WSL 2 (#7137) 2025-12-11 15:09:00 -08:00
onboarding [device-auth] Update login instruction for headless environments. (#8753) 2026-01-05 13:46:42 -08:00
public_widgets tui: refactor ChatWidget and BottomPane to use Renderables (#5565) 2025-11-05 09:50:40 -08:00
render tui: refactor ChatWidget and BottomPane to use Renderables (#5565) 2025-11-05 09:50:40 -08:00
snapshots [tui] add optional details to TUI status header (#8293) 2025-12-23 12:40:40 -08:00
status Remove model family from tui (#8488) 2026-01-02 11:30:04 -08:00
streaming tui: drop citation rendering (#4855) 2025-10-20 21:08:19 +00:00
tui perf(tui): cap redraw scheduling to 60fps (#8499) 2025-12-23 19:10:15 -08:00
additional_dirs.rs feat: introduce ExternalSandbox policy (#8290) 2025-12-18 17:02:03 -08:00
app.rs Remove model family from tui (#8488) 2026-01-02 11:30:04 -08:00
app_backtrack.rs Remove model family from tui (#8488) 2026-01-02 11:30:04 -08:00
app_event.rs feat: open prompt in configured external editor (#7606) 2025-12-22 15:12:23 -08:00
app_event_sender.rs tui: switch to using tokio + EventStream for processing crossterm events (#2489) 2025-08-20 17:11:09 +00:00
ascii_animation.rs chore: remove model upgrade popup (#4332) 2025-09-27 13:25:09 -07:00
chatwidget.rs feat(app-server): thread/rollback API (#8454) 2026-01-06 21:23:48 +00:00
cli.rs tui: add branch to 'codex resume', filter by cwd (#6232) 2025-11-19 00:47:37 +00:00
clipboard_paste.rs FIX: WSL Paste image does not work (#6793) 2025-12-04 10:50:20 -08:00
color.rs update composer + user message styling (#4240) 2025-09-26 16:35:56 -07:00
custom_terminal.rs refactor(terminal): cleanup deprecated flush logic (#6373) 2025-11-07 15:54:07 -08:00
diff_render.rs fix: render cwd-relative paths in tui (#8771) 2026-01-06 03:17:40 +00:00
exec_command.rs fix(windows) shell_command on windows, minor parsing (#6811) 2025-11-17 22:23:53 -08:00
external_editor.rs feat: open prompt in configured external editor (#7606) 2025-12-22 15:12:23 -08:00
file_search.rs Bumped number of fuzzy search results from 8 to 20 (#7013) 2025-11-20 12:33:12 -08:00
frames.rs Login flow polish (#3632) 2025-09-15 00:42:53 -07:00
get_git_diff.rs Show progress indicator for /diff command (#2245) 2025-08-15 15:32:41 -07:00
history_cell.rs feat: forced tool tips (#8752) 2026-01-06 18:02:05 +00:00
insert_history.rs fix(tui): propagate errors in insert_history_lines_to_writer (#4266) 2025-10-30 18:07:51 -07:00
key_hint.rs Add vim navigation keys to transcript pager (#7550) 2025-12-09 10:23:11 -08:00
lib.rs feat: forced tool tips (#8752) 2026-01-06 18:02:05 +00:00
live_wrap.rs Stream model responses (#1810) 2025-08-05 04:23:22 +00:00
main.rs fix codex resume message at end of session (#3957) 2025-09-22 22:24:31 +00:00
markdown.rs tui: drop citation rendering (#4855) 2025-10-20 21:08:19 +00:00
markdown_render.rs Changed default wrap algorithm from OptimalFit to FirstFit (#7960) 2025-12-12 21:47:37 -08:00
markdown_render_tests.rs tui: centralize markdown styling and make inline code cyan (#7023) 2025-11-20 21:06:22 +00:00
markdown_stream.rs tui: drop citation rendering (#4855) 2025-10-20 21:08:19 +00:00
model_migration.rs splash screen (#8270) 2025-12-18 10:59:53 -08:00
oss_selection.rs LM Studio OSS Support (#2312) 2025-11-17 11:49:09 -08:00
pager_overlay.rs Add vim navigation keys to transcript pager (#7550) 2025-12-09 10:23:11 -08:00
resume_picker.rs chore: migrate from Config::load_from_base_config_with_overrides to ConfigBuilder (#8276) 2025-12-18 16:12:52 -08:00
selection_list.rs splash screen (#8270) 2025-12-18 10:59:53 -08:00
session_log.rs tui: bring the transcript closer to display mode (#4848) 2025-10-07 16:18:48 -07:00
shimmer.rs tui: hardcode xterm palette, shimmer blends between fg and bg (#4957) 2025-10-08 20:23:13 +00:00
slash_command.rs chore: un-ship undo (#8424) 2025-12-22 09:53:03 +01:00
status_indicator_widget.rs [tui] add optional details to TUI status header (#8293) 2025-12-23 12:40:40 -08:00
style.rs tui: hardcode xterm palette, shimmer blends between fg and bg (#4957) 2025-10-08 20:23:13 +00:00
terminal_palette.rs perf(tui2): cache transcript view rendering (#8693) 2026-01-03 11:44:27 -08:00
test_backend.rs feat: Constrain values for approval_policy (#7778) 2025-12-17 16:19:27 +00:00
text_formatting.rs [tui] add optional details to TUI status header (#8293) 2025-12-23 12:40:40 -08:00
tooltips.rs feat: forced tool tips (#8752) 2026-01-06 18:02:05 +00:00
tui.rs perf(tui): cap redraw scheduling to 60fps (#8499) 2025-12-23 19:10:15 -08:00
ui_consts.rs Fixes (#4458) 2025-09-30 00:10:04 +00:00
update_action.rs fix: update brew auto update version check (#6238) 2025-11-10 09:05:00 -08:00
update_prompt.rs fix: update brew auto update version check (#6238) 2025-11-10 09:05:00 -08:00
updates.rs Allow enterprises to skip upgrade checks and messages (#7213) 2025-11-24 15:04:49 -05:00
version.rs Added CLI version to /status output (#3223) 2025-09-05 16:27:31 -07:00
wrapping.rs Changed default wrap algorithm from OptimalFit to FirstFit (#7960) 2025-12-12 21:47:37 -08:00