Repository navigation
refactor(commands): move /checkpoint load, /resume and /retry onto StatefulCommand - #2122
Merged
Merged
Conversation
…atefulCommand
Their logic moves from app/utils/handlers/ into the command modules, and
the session, checkpoint and retry handlers are deleted. CommandContext
gains argText (the raw text after the name, for quote-aware or raw-split
parsing), provider, model, the checkpoint and session setters,
switchModel and submitChatMessage. CommandCompletion gains 'handed-off'
(a chat turn or picker completes the command) and {show} (output shown
the way a read-only command's result is), which /checkpoint uses for
every subcommand except a bare load/restore.
No behaviour change.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
No changeset foundThis PR does not add a changeset, so it will not appear in the changelog or trigger a release. If the change is user-facing, add one: pnpm changesetPick a bump (patch / minor / major) and write the changelog entry in our usual voice ("Added X... Thanks to @you. Closes #123."), then commit the generated If this PR is docs-only or a chore that needs no release note, you can ignore this — or run |
Contributor
|
nc-review could not produce a verdict this run (agent exit |
This was referenced Nov 11, 2026
jay23606
added a commit
to jay23606/nanocoder
that referenced
this pull request
Nov 12, 2026
…atefulCommand (Nano-Collective#2122) Their logic moves from app/utils/handlers/ into the command modules, and the session, checkpoint and retry handlers are deleted. CommandContext gains argText (the raw text after the name, for quote-aware or raw-split parsing), provider, model, the checkpoint and session setters, switchModel and submitChatMessage. CommandCompletion gains 'handed-off' (a chat turn or picker completes the command) and {show} (output shown the way a read-only command's result is), which /checkpoint uses for every subcommand except a bare load/restore. No behaviour change. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
PR 3 of the command-dispatcher sequence (#2098, #2114, then #2116 for case-insensitive names).
What changed
/retry,/resume,/checkpointnow hold their own logic insource/commands/{retry,resume,checkpoint}.handlers/session-handler.ts,handlers/retry-handler.ts(and its spec) andhandlers/checkpoint-load-handler.tsare deleted, and the dispatcher's handler chain loses those three steps.CommandContextgains:argText: the raw text after the command name, so/retrykeeps its quote-aware parsing (--model "a b") and/resumeand/checkpointkeep their raw split.providerandmodel.enterCheckpointLoadMode.enterSessionSelectorMode,resumeSessionandswitchModel. These are optional, so the "not available in this context" messages still show.submitChatMessage.CommandCompletiongains two values:'handed-off': something the command started completes it./retryhands off to the retried chat turn; a bare/checkpoint loadhands off to the picker.{show}: output shown exactly the way a read-only command's result is (queued on a microtask, completion after the render delay)./checkpointreturns its other subcommands this way, so it is one command instead of a render command plus an intercept.runCheckpointSubcommand.Behaviour
No change intended:
/retrystill never signals completion itself./resumecompletes after the session switch finishes./checkpoint loadorrestore(exact lowercase, exactly one argument) opens the picker; everything else renders as before./sessionsand/historyreach/resumethrough the alias table (fix(commands): match built-in slash command names in any case #2116).Tests
command-dispatcher.spec.ts:/retryhands off and never completes, and the dispatcher doesn't signal completion either. This replacesretry-handler.spec.ts./retrykeeps a quoted--modelvalue whole./checkpoint loadwith no checkpoints, and/checkpoint restoreopening the picker without completing./checkpoint helpshows like a read-only command.checkpoint.spec.tsxnow callsrunCheckpointSubcommandinstead ofcheckpointCommand.handler, with the same assertions throughout.useAppHandlers.spec.tsx:lazyCommands, as the app does at init and asapp-util.specalready does, because/resumeresolves through the registry./resumeswitch test polls on a 5 ms timer (up to 2 s) instead of 50setImmediateturns, because loading the command module is real I/O. The assertions are unchanged.app-util.specresume and retry tests pass unchanged.tsc --noEmit,biome check .,knipandknip --production --include files. AVA passes over source/app/utils, source/commands,commands.spec.ts, source/session (911 tests), plus source/hooks, source/app/sections and source/plain (640 tests).🤖 Generated with Claude Code