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
{{ message }}
Repository navigation
Emit structured CLI errors and document every exit code #18
Agents therefore have to parse English to tell "capacity reached" from
"unknown model". Related gaps:
REQUESTER_ALREADY_LEASED has no entry in DAEMON_ERROR_EXIT_CODES
(src/cli/index.ts), so it falls through to the generic exit 1 and is not
listed in the docs/CLI.md exit-code table. This is a routine outcome,
not an edge case: one lease per agent is the v1 rule, so any agent that
tries to hold iOS and Android at once hits it, and the message should tell
it to release the first lease rather than look like an internal error.
--json is accepted on lease but never affects its output.
Proposed change
On failure, write a single structured line to stderr: {"error":{"code":"...","message":"..."}}, using the daemon's error code
where one exists and a stable CLI code otherwise (USAGE, INTERNAL).
Add REQUESTER_ALREADY_LEASED to the exit-code map with its own code, and
give it an actionable message naming the lease that must be released first.
Document every code and its exit status in the docs/CLI.md table,
including the ones already implemented but undocumented.
Make --json consistent: either it is accepted and meaningful everywhere,
or rejected where output is always JSON. Pick one and apply it uniformly.
Acceptance criteria
Every CLI failure path writes one structured JSON error line to stderr.
Exit codes are unchanged for the cases docs/CLI.md already documents
(10 / 11 / 12 / 2 / 1).
REQUESTER_ALREADY_LEASED has a dedicated exit code, an actionable
message, and a documented entry.
Activity