Repository navigation
refactor(commands): move /stats and /login onto StatefulCommand - #2128
Merged
Merged
Conversation
Both mount a live component and finish when it closes. They now return
{until: promise} and the dispatcher hands the prompt back when it
settles, instead of each handler calling onCommandComplete from its
close callback. CommandContext gains the live-component setters and
setIsToolExecuting. /login without a known target returns its usage
through {show}, as the stub handler's result was shown before. The
stats and login handlers are deleted.
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
…-Collective#2128) Both mount a live component and finish when it closes. They now return {until: promise} and the dispatcher hands the prompt back when it settles, instead of each handler calling onCommandComplete from its close callback. CommandContext gains the live-component setters and setIsToolExecuting. /login without a known target returns its usage through {show}, as the stub handler's result was shown before. The stats and login handlers are deleted. 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 4 of the command-dispatcher sequence (#2098, #2114, #2116, #2122).
What changed
/statsand/loginare nowStatefulCommands insource/commands/{stats.tsx,login.ts}.handlers/stats-handler.tsandhandlers/login-handler.tsare deleted, and the dispatcher's handler chain loses both steps.CommandCompletiongains{until: Promise<void>}for a command that keeps running in a live component. The command resolves the promise from the component's close callback, and the dispatcher hands the prompt back when it settles. The dispatcher does not wait on it, sohandleMessageSubmissionstill returns right after the component mounts, as before. Commands no longer reachonCommandCompletefrom inside a callback.CommandContextgainssetLiveComponent,setLiveComponentCapturesInputandsetIsToolExecuting./loginwithout a known target returns its usage through{show}, the same route the old stub'shandlerresult took (queued, then completion after the render delay).Behaviour
No change intended:
/statscaptures input and leaves a static snapshot when closed./stats resetand its usage error behave as before./login codex|copilot [name](and/codex-login,/copilot-login) sets tool-executing, mounts the device flow, and on finish clears it and reports success or error.One timing detail: completion now lands one microtask after the close callback rather than inside it. Nothing reads app state between the two.
Tests
command-dispatcher.spec.ts:/statsstays incomplete until its card closes, then releases input and completes once./login COPILOT Work Copilotkeeps the provider name, toggles tool-executing, reports the error and completes when the flow finishes./login githubshows the usage like a read-only command.stats.spec.tsxnow checks forruninstead of the stub'shandler.app-util.spectests for stats capture/close, stats reset and every login alias pass unchanged.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 source/components/stats (1406 tests).🤖 Generated with Claude Code