You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: keep every word of an unquoted prompt, and stop a mistyped command from starting a session (#96)
`agent fix the tests` sent just "fix". The positional was a single
argument, so commander bound the first word and dropped the rest with no
error. Making it variadic and joining on spaces fixes that, and gives
`--` a useful meaning for free: `agent -- why does -m fail` now sends the
whole line. `session handoff` had the same truncation.
A bare word is also treated as a prompt, so `agent sesion` used to start
a session instead of failing. The guard keys on shape, not edit distance:
one word with no spaces and no leading dash is a mistake, and anything
longer is a prompt. Edit distance decides only the wording of the hint,
never whether to block. Gating on it would have been much worse. Of 68
common prompt-opening words, 23 land within commander's match threshold
of a command name (revert/review, audit/budget, test/host), so
`agent revert the migration` would have been refused.
`agent sesion list` still slips through. A near-miss plus a known
subcommand looked like the fix, but it also caught `revert list` and
`audit list`. Blocking a real prompt is worse than missing a typo.
Forcing a one-word prompt through: `agent -p refactor` or
`agent -- refactor`. Quoting cannot work, since the shell strips it,
which is why the error names `-p`.
0 commit comments