…ories
fa89d87 (NousResearch#10505, reapply of PR NousResearch#10633 by @nightq) fixed the classic
CLI's bare /rollback: when the current directory has zero checkpoints, it
now falls back to a cross-project "all directories" view instead of
reporting "no checkpoints found" despite fresh checkpoints existing under
a different cwd. Two other independent implementations of the same bare
/rollback listing never got the fix:
- gateway/slash_commands.py::_handle_rollback_command — used by every
chat-platform /rollback (Discord, Slack, Telegram, etc.)
- tui_gateway/methods_tools.py's rollback.list RPC — used by the Ink TUI's
/rollback (ops.ts), and planned for Desktop per NousResearch#90029
Both now call the same CheckpointManager.list_all_checkpoints() the CLI's
fix already introduced, mirroring its exact fallback condition (session's
own cwd has zero checkpoints, but at least one other directory has some).
The RPC additionally surfaces a new all_directories boolean so a future
UI update can label the fallback list the way the CLI's text output does;
today's TUI client already renders the (larger) checkpoint list correctly
without it.
Summary
fa89d87ea6(#10505, reapply of PR #10633 by @nightq) fixed the classic CLI's bare/rollback: when the current directory has zero checkpoints, it now falls back to a cross-project "all directories" view instead of reporting "No checkpoints found" despite fresh checkpoints existing under a different cwd (the fix's own commit message: writes landed checkpoints under the session cwd/tmp/qa-repowhile bare/rollbacksearched onlyTERMINAL_CWD's project).Two other independent implementations of the exact same bare-
/rollback-listing logic never got the fix:gateway/slash_commands.py::_handle_rollback_command— the handler behind every chat-platform/rollback(Discord, Slack, Telegram, etc.)tui_gateway/methods_tools.py'srollback.listRPC — used by the Ink TUI's/rollback(ui-tui/src/app/slash/commands/ops.ts), and planned for Desktop per open PR fix(desktop): route /rollback through the native rollback RPCs instead of the slash worker #90029 ("route /rollback through the native rollback RPCs instead of the slash worker")Both still just call
mgr.list_checkpoints(cwd)and return whatever comes back — empty if empty, with no fallback and no hint that checkpoints exist elsewhere.Fix
Both now call
CheckpointManager.list_all_checkpoints()(the method the CLI's own fix introduced) with the exact same fallback condition: only when the session's own cwd has zero checkpoints AND at least one other directory has some."No checkpoints for {cwd} — showing all directories."+ the labeled list).all_directories: boolfield so a future UI update can label the fallback list the way the CLI does; today's TUI client already renders the (larger) checkpoint list correctly without reading that field — nothing breaks by its absence being ignored.Verification
tests/gateway/test_rollback_command.py(end-to-end against a realCheckpointManager+ real git checkpoint store, mirroringtests/gateway/test_diff_command.py's established pattern) andtests/tui_gateway/test_rollback_list_rpc.py(invokes the installedrollback.listhandler viaserver._methods["rollback.list"], same pattern astests/tui_gateway/test_projects_rpc.py). Both cover: falls back when own-cwd is empty, no fallback claim when nothing exists anywhere, and own-cwd checkpoints always take priority over the fallback.KeyError: 'all_directories', missing fallback text) while the 2 "no fallback needed" negative controls correctly still pass unchanged. Restored the fixes, all 6 pass.tests/gateway/test_rollback_command.py tests/gateway/test_diff_command.py tests/tui_gateway/test_rollback_list_rpc.py tests/tools/test_checkpoint_manager.py tests/tools/test_rollback_all_directories.py— 60 passed, no regressions.ruff checkclean on all changed files.Notes
/rollback <N>) is intentionally left untouched, matching the CLI's own established scope: the fallback view is informational only (it shows what exists elsewhere so the user knows tocdthere), not a promise that<N>against the shown listing is directly restorable — the CLI's own fix has this same limitation.rollback.list's response reads a checkpoint'smessagefield viac.get("message", ""), butCheckpointManager.list_checkpoints()actually names that fieldreason— every checkpoint'smessagehas always come back empty. This is a separate, pre-existing bug unrelated to the all-directories fallback and is left out of scope here._handle_rollback_commandor therollback.listRPC. fix(gateway): /rollback now undoes the conversation turn it reverts #78603 (open, "/rollbacknow undoes the conversation turn it reverts") touches a different branch of the same function (the successful-restore path,if result["success"]:) — no overlap.Test plan
tests/gateway/+tests/tui_gateway/+tests/tools/checkpoint/rollback suite greenruff checkclean