Skip to content

Commit 160f418

Browse files
committed
feat: emit drift diagnostic for registered-but-unhandled commands
Folds #1055's telemetry into this branch: known-command fall-through now emits cli_known_command_unhandled at error level alongside the distinct user-facing message, so catalog/dispatch drift is visible in diagnostics as well as to the user who hits it.
1 parent 290ffd8 commit 160f418

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/cli.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,13 @@ function isDebugRequested(argv: string[]): boolean {
460460

461461
function formatUnhandledCommandMessage(command: string): string {
462462
if (isKnownCliCommandName(command)) {
463+
// Registered-but-unhandled means catalog/dispatch drift — make it visible
464+
// in telemetry too, not just the thrown message (from #1055).
465+
emitDiagnostic({
466+
level: 'error',
467+
phase: 'cli_known_command_unhandled',
468+
data: { command },
469+
});
463470
return `Command is registered but no CLI handler accepted it: ${command}`;
464471
}
465472
return `Unknown command: ${command}`;

0 commit comments

Comments
 (0)