Repository navigation
fix(cli): keep Gateway auth failures parseable in JSON - #116597
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 8:35 PM ET / July 31, 2026, 00:35 UTC. ClawSweeper reviewWhat this changesThe branch adds a shared formatter for pre-transport Gateway credential errors and applies it to JSON-mode health, routed Gateway health, and Gateway call commands so automation receives a parseable Merge readinessKeep this PR open for protected-label maintainer handling. The focused patch appears to preserve the existing Gateway error taxonomy while making three JSON CLI entry points emit the established credential envelope; its reported built-CLI proof is strong, but the exact head still has required checks in progress and the Priority: P2 Review scores
Verification
How this fits togetherGateway-backed CLI commands resolve credentials before opening a WebSocket transport, then format failures for either people or JSON automation. This change intercepts recognized credential failures at that pre-transport boundary and returns the existing structured JSON error instead of falling through to empty or prose-only output. flowchart LR
A[CLI JSON command] --> B[Gateway credential resolution]
B --> C{Credentials available?}
C -- Yes --> D[Gateway request and transport]
C -- No --> E[Shared auth error formatter]
E --> F[Parseable credentials-required JSON]
D --> G[Existing success or transport result]
Decision needed
Why: The patch is narrowly scoped and evidence-backed, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +37, Tests +286. Total +323 across 9 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrow shared formatter after exact-head checks complete and a maintainer confirms that Do we have a high-confidence way to reproduce the issue? Yes, source and the PR’s reported built-CLI evidence define a concrete path: invoke JSON-mode Gateway health or call commands with missing, explicit-URL, or unavailable SecretRef credentials and inspect stdout, stderr, exit code, and error type. This review did not independently rerun that process. Is this the best way to solve the issue? Yes. A single shared formatter at the credential/transport boundary, called before existing request and transport formatters, is narrower and less drift-prone than separate error serialization logic in each CLI entry point. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c6104457614. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…e2e-integration-20260730 * origin/main: fix(plugins): keep registry sqlite root consistent (#116427) fix(cli): keep Gateway auth failures parseable in JSON (#116597) fix(trajectory): preserve prompts in oversized events (#116220) test(buzz): add live QA Lab channel lane (#116298) chore(i18n): refresh native locales (#116567) feat: add OpenClaw TUI prototype skill (#116583) fix(update): accept concrete versions selected by ranges (#116585)
…-supported-paths * origin/main: (168 commits) fix(plugins): keep registry sqlite root consistent (#116427) fix(cli): keep Gateway auth failures parseable in JSON (#116597) fix(trajectory): preserve prompts in oversized events (#116220) test(buzz): add live QA Lab channel lane (#116298) chore(i18n): refresh native locales (#116567) feat: add OpenClaw TUI prototype skill (#116583) fix(update): accept concrete versions selected by ranges (#116585) fix(agents): preserve locked session model routes test(qa-lab): preserve Matrix fault proxy identity fix(ci): extend OpenAI live profile setup budget (#116580) fix: prevent configured models from stalling startup (#116553) fix(cli): close MCP listener after one-shot commands fix(auto-reply): keep explicit NO_REPLY silent (#116548) test(discord): cover deferred backpressure terminals fix(discord): cancel backpressured realtime playback test(discord): cover realtime output backpressure fix(codex): add remote WebSocket heartbeat and reconnect (#116135) fix(macos): wait for the current reconnect snapshot (#116550) fix(outbound): recognize current-source message-tool sends (#116560) fix(voice-call): type cancelled consult outcomes ... # Conflicts: # extensions/google/setup-api.test.ts # ui/src/e2e/model-setup.e2e.test.ts
* fix(cli): preserve gateway auth JSON errors * docs(changelog): note Gateway JSON auth errors * docs(changelog): defer Gateway JSON note to release
* origin/main: fix(plugins): keep registry sqlite root consistent (openclaw#116427) fix(cli): keep Gateway auth failures parseable in JSON (openclaw#116597) fix(trajectory): preserve prompts in oversized events (openclaw#116220) test(buzz): add live QA Lab channel lane (openclaw#116298) chore(i18n): refresh native locales (openclaw#116567) feat: add OpenClaw TUI prototype skill (openclaw#116583) fix(update): accept concrete versions selected by ranges (openclaw#116585) fix(agents): preserve locked session model routes
…-supported-paths * origin/main: (168 commits) fix(plugins): keep registry sqlite root consistent (openclaw#116427) fix(cli): keep Gateway auth failures parseable in JSON (openclaw#116597) fix(trajectory): preserve prompts in oversized events (openclaw#116220) test(buzz): add live QA Lab channel lane (openclaw#116298) chore(i18n): refresh native locales (openclaw#116567) feat: add OpenClaw TUI prototype skill (openclaw#116583) fix(update): accept concrete versions selected by ranges (openclaw#116585) fix(agents): preserve locked session model routes test(qa-lab): preserve Matrix fault proxy identity fix(ci): extend OpenAI live profile setup budget (openclaw#116580) fix: prevent configured models from stalling startup (openclaw#116553) fix(cli): close MCP listener after one-shot commands fix(auto-reply): keep explicit NO_REPLY silent (openclaw#116548) test(discord): cover deferred backpressure terminals fix(discord): cancel backpressured realtime playback test(discord): cover realtime output backpressure fix(codex): add remote WebSocket heartbeat and reconnect (openclaw#116135) fix(macos): wait for the current reconnect snapshot (openclaw#116550) fix(outbound): recognize current-source message-tool sends (openclaw#116560) fix(voice-call): type cancelled consult outcomes ... # Conflicts: # extensions/google/setup-api.test.ts # ui/src/e2e/model-setup.e2e.test.ts
What Problem This Solves
Fixes an issue where Gateway-backed CLI commands requested in JSON mode could fail before transport startup with empty stdout or prose stderr when credentials were missing or unavailable. Automation calling
health, routedgateway health, orgateway callcould not reliably parse the failure.Why This Change Was Made
A shared Gateway auth-error formatter now maps only the recognized pre-transport credential failures into the existing
gateway_credentials_requiredJSON envelope. All three CLI entry points apply it before request/transport formatters, while reachable-Gateway diagnostics and authenticated transport failures retain their existing distinct envelopes.No authentication policy, credential lookup, Gateway protocol, config, or human-readable command behavior changes.
User Impact
JSON callers always receive one parseable failure object and a nonzero exit for missing Gateway credentials. Authenticated connection failures still report
gateway_transport_error, so automation can distinguish setup from reachability.Evidence
tbx_01kytm93xjqqw9ncpczm3qkh0rpassed all 5 contract clauses: three credential-failure entry points, explicit-URL auth failure, and authenticated unreachable transport failure. Every case exited 1, emitted zero stderr bytes, and parsed the complete stdout JSON as the expected error type.git diff --checkis clean.