fix: name hyp daemon start in CLI repair paths - #844
Conversation
Two live failure paths told users to run `hyp start`, a command the registry never had: the attach endpoint give-up message for an installed but unreachable daemon, and the ai-gateway session endpoint resolution error. Following either printed repair produced a second failure, `hyp: unknown command 'start'`. The registered lifecycle command is `hyp daemon start`. Both messages now name the registered spelling, and the comments that described the old repair follow. A new test resolves every `hyp ...` spelling those messages print against the real core command registry, using the dispatcher's own longest-prefix rule, so a repair line can no longer name a command the dispatcher would reject. No top-level `start` alias is added. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…any cast The mention pattern matched only a run of lowercase words closed immediately by a delimiter, so any repair carrying a flag or a placeholder matched nothing and was skipped in silence. On the no-daemon-installed message, whose two mentions include one that stays well-formed, that is a green suite over an unrunnable repair: reword it to `hyp start --foreground` and the guard never sees it. Capture the body up to the closing delimiter instead and split it into argv, which is what `registry.match` already consumes; the dispatcher stops at the first flag on its own, so flags need no special case beyond skipping a mention that is only a flag on the binary (`hyp --help`). The group check now spares a help flag, matching `makeGroupCommand`'s own rule via the exported `isHelpFlag`, so `hyp daemon --help` is not read as an unknown subcommand. `registerCoreCommands` takes exactly `ReturnType<typeof createCommandRegistry>`, so the `any` cast on the registry bought nothing and hid the argument from the typechecker. Every other caller in the repo passes the registry directly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Neutral review round:
|
The guard only saw `hyp ...` mentions wrapped in backticks, quotes, or parens, and its "named no hyp command to check" floor is per message, not per mention. In the no-daemon-installed message, which names two commands, an undelimited `hyp start` was skipped silently while the other mention kept the floor satisfied: all three cases stayed green with the exact "hyp: unknown command 'start'" dead end back in the tree. Verified by mutation before and after. Also: forward-correct LLP 0178's T7 task line, which still instructs a future implementer to keep the `hyp start` mention, and make the attach-endpoint-fallback @ref gloss say what the test actually pins. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review:
|
|
Triage at head
|
|
Closing as superseded by #857. The task-oriented CLI rollover shipped the |
Problem
Two live failure paths printed
hyp startas the repair, but no such command is registered. Following the printed advice produced a second failure:The registered lifecycle command is
hyp daemon start.Change
src/core/commands/clients.js: the attach endpoint give-up message for an installed but unreachable daemon now says(hyp daemon start). The no-daemon-installed branch is unchanged (it already namedhyp daemon install/hyp daemon start).hypaware-core/plugins-workspace/ai-gateway/src/session_command.js:resolveGatewayEndpointForCli's error now says`hyp daemon start`.src/core/commands/clients.jsandsrc/core/cli/remote_commands.jsthat described the old repair follow the wording.test/core/attach-endpoint-fallback.test.js: the case that preserved the bad spelling now requires the registered one.No top-level
startalias is added, per the acceptance criteria.Regression test
test/core/repair-command-spelling.test.jsextracts every quoted or parenthesizedhyp ...mention from the two give-up messages and resolves it against a real core command registry (createCommandRegistry+registerCoreCommands) using the dispatcher's own longest-registered-prefix rule, plus a group check so an unknown subcommand under a group command (hyp daemon <x>) also fails.Before the fix, 2 of its 3 cases failed:
After the fix all 3 pass. Locally:
npm test4260 pass / 0 fail,npm run typecheckclean.Fixes #834