Repository navigation
refactor(commands): move /compact and /context-max onto StatefulCommand - #2133
Merged
Merged
Conversation
Their logic moves from app/utils/handlers/ into the command modules, which were the last createStubCommand stubs, so create-stub-command.ts is deleted. Every completion that was a setTimeout(onCommandComplete, 100) is now a returned 'done-after-render', and the immediate ones 'done'. CommandContext gains setMessages, client, providerConfig and onceThreshold, which the dispatcher now passes through for /compact ?threshold=. 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 |
…atcher-compact # Conflicts: # source/app/utils/command-dispatcher.spec.ts
This was referenced Nov 11, 2026
jay23606
added a commit
to jay23606/nanocoder
that referenced
this pull request
Nov 12, 2026
…nd (Nano-Collective#2133) Their logic moves from app/utils/handlers/ into the command modules, which were the last createStubCommand stubs, so create-stub-command.ts is deleted. Every completion that was a setTimeout(onCommandComplete, 100) is now a returned 'done-after-render', and the immediate ones 'done'. CommandContext gains setMessages, client, providerConfig and onceThreshold, which the dispatcher now passes through for /compact ?threshold=. 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 5a of the command-dispatcher sequence (#2098, #2114, #2116, #2122, #2128). The
createsubcommands follow in 5b, after #2132.What changed
/compactand/context-maxare nowStatefulCommands that hold their own logic insource/commands/{compact,context-max}.ts.handlers/compact-handler.tsandhandlers/context-max-handler.tsare deleted.createStubCommandstubs, socreate-stub-command.tsis deleted. No built-in command module is an empty stub any more.setTimeout(() => onCommandComplete?.(), DELAY_COMMAND_COMPLETE_MS)(10 in compact, 4 in context-max) is now a returned'done-after-render'. Each immediateonCommandComplete?.()is a returned'done'. The one remaining after-render timer lives in the dispatcher'scompleteCommand.CommandContextgainssetMessages,client,providerConfigandonceThreshold. The dispatcher passes the?threshold=value it parsed through to the command, so/compact ?threshold=80keeps its gate.compact.tsstub stays as the command's doc comment.Behaviour
No change intended. Both commands read the same split arguments as before: the post-override tokens for
/compact, the raw split for/context-max.Tests
context-max-handler.spec.tsmoves tosource/commands/context-max.spec.ts. It callscontextMaxCommand.run, keeps the same assertions, and also checks the completion it returns./context-max 64ksets the session limit and completes after render./compactwith no messages completes at once./compact --auto-offcompletes after render.app-util.speccompact tests pass unchanged, including both?threshold=gate cases and?context-max.tsc --noEmit,biome check .,knipandknip --production --include files. AVA passes over source/app/utils, source/commands,commands.spec.ts, source/hooks, source/app/sections, source/plain and the auto-compact and inline-override utils (1486 tests).🤖 Generated with Claude Code