Repository navigation
fix(cli): preserve existing proxy and transcript error reasons - #191295
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Built-CLI diagnostic sweep proofHead: Includes #191225 and #191219, both by @yxshee. Ownership rechecked: unassigned contributor PRs, all original commits attributed to @yxshee, no maintainer commits. Cherry-picked original commits Excluded #191237 because it adds a new source-checkout error message/helper, and #191233 because it rewrites token/password error wording. This sweep only classifies existing text using the dependency-light ExpectedCliError owner from merged #189993. No new production message text. Real entry-point comparisonIndependently built runtime artifacts in secretless Linux arm64 For each row below: main twice prints the generic root failure on stderr; candidate twice prints exactly the existing reason on stderr. Exit code remains 1 in all runs.
Captured baseline stderr example:
{"ok":false,"error":{"type":"cli_error","message":"Unknown blob: missing-blob"}}Identical controlsAll four runs pass all six controls, exit 0, and retain clean stderr:
Control comparison normalizes only task-owned root paths and the synthetic summary generation timestamp, not diagnostic text, payloads, session fields or exit codes. All six comparisons are equal across main1/main2/candidate1/candidate2. Focused checks and simplification49 tests passed: proxy runtime (25), transcript CLI (5), failure-output owner (19). Targeted Oxlint and Oxfmt passed. The updated existing transcript regression fails on main because its missing-summary error lacks the expected human-output contract; all four other cases pass. Exact diagnostic text and both commands' missing/no-summary boundaries are covered by the repeated real CLI comparison above. Reused the existing transcript case instead of retaining duplicate helper-level classification cases; retained the contributor production commits and existing error owner. Whole-change deltas against the merge base: production +8/-6 (net +2), tests +1/-1 (net 0), docs +7/-0. No new exports, SDK contracts, compatibility readers, configuration, permissions, stored formats or message wording. No broad local typecheck or hosted job reruns. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR makes six proxy and transcript failures display their existing specific reasons through the shared CLI error renderer. Example: Run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes current diagnostic failures with a minimal change, and no actionable correctness or security defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCommander dispatches proxy and transcript commands to their existing runtime owners, whose errors reach the shared renderer for stderr diagnostics, JSON failures, and exit status. flowchart LR
A[CLI arguments] --> B[Command registration]
B --> C[Proxy or transcript owner]
C --> D[Existing capture or transcript store]
C --> E[Expected CLI error]
E --> F[Shared failure renderer]
F --> G[Specific diagnostic and exit 1]
Technical reviewBest possible solution: Classify these six expected refusals through the existing error helper while retaining their messages, validation, storage owners, JSON behavior, and exit status. Do we have a high-confidence way to reproduce the issue? Current-main producers and the shared renderer establish the failure path, and the supplied built CLI comparison demonstrates it on the unchanged baseline owners; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete fix: expected refusals must retain their reasons at the root renderer, and every production hunk reuses the existing classification owner without adding another path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d29a7705651d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests 0, Docs +7. Total +9 across 5 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 2, 2026, 11:54 AM ET / 16:54 UTC. |
…law#191295) fix(cli): show existing specific errors instead of the generic CLI failure Some CLI commands already had a specific error reason, but the root CLI replaced it with the generic "The CLI command failed." output. These existing diagnostics are now raised as `ExpectedCliError`, the same way as openclaw#189993, so users see the specific reason. The message text and the exit code (1) are unchanged, and success and JSON output are unchanged. This sweep includes openclaw#191225 and openclaw#191219, with yxshee's commits kept for credit. Evidence: built CLI in secretless Node 24.22.1 Docker. All six failure paths showed the generic failure on main twice and the existing specific reason with this change twice, with exit code 1. Six success and JSON controls were unchanged. Details: openclaw#191295 (comment). Thanks @yxshee. Co-authored-by: yxshee <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
… when the flag comes before the subcommand (#190366) fix(cli): show existing hooks validation errors instead of the generic failure Two `hooks` command validations already had specific error messages, but the root CLI replaced them with the generic "The CLI command failed." output. These validations now raise `ExpectedCliError`, the same way as #189993 and #191295, so users see the specific reason. The message text, exit code (1) and JSON envelopes are unchanged. Evidence: built CLI in secretless Node 24.22.1 Docker. Both validations showed the generic failure on main twice and the specific reason with this change twice, with exit code 1. Valid parent and leaf invocations, JSON output and the existing leaf diagnostic were unchanged. Details: #190366 (comment). Thanks @yxshee. Co-authored-by: Ayaan Zaidi <[email protected]>
… when the flag comes before the subcommand (openclaw#190366) fix(cli): show existing hooks validation errors instead of the generic failure Two `hooks` command validations already had specific error messages, but the root CLI replaced them with the generic "The CLI command failed." output. These validations now raise `ExpectedCliError`, the same way as openclaw#189993 and openclaw#191295, so users see the specific reason. The message text, exit code (1) and JSON envelopes are unchanged. Evidence: built CLI in secretless Node 24.22.1 Docker. Both validations showed the generic failure on main twice and the specific reason with this change twice, with exit code 1. Valid parent and leaf invocations, JSON output and the existing leaf diagnostic were unchanged. Details: openclaw#190366 (comment). Thanks @yxshee. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
The CLI hides existing, actionable proxy and transcript input errors behind
The CLI command failed.These are expected user conditions, not internal crashes.Includes #191225 and #191219 by @yxshee. Their original commits are cherry-picked with author credit retained. Related implementation precedent: #189993.
User Impact
The CLI now prints its existing specific reason for:
proxy runwithout a child command andproxy blobwith an unknown id.transcripts showandtranscripts pathwith an unknown session or missing summary.Exit status remains 1. Successful commands, captured bytes, transcript exports and existing JSON output are unchanged. No new production message text.
Why This Change Was Made
Classify those six existing refusals through the dependency-light
throwExpectedCliErrorowner, so the root renderer displays their diagnostic instead of treating them as unexpected exceptions. No new helper, configuration, API or persistence behavior.Excluded from this bounded repair: #191237 adds a new source-checkout diagnostic/helper; #191233 changes missing token/password wording. Those need separate consideration and are not included here.
Evidence
Built main
e8f91361abfe44ab7b0155fa5a4bf60f343eebc3and candidate in secretless Linux arm64 Node 24.22.1 Docker, with isolated profiles and synthetic transcript/capture state.Detailed captured output: built-CLI proof comment.
Merge Danger
Two-way door: reverting fully restores the prior error classification; no migration or persistent-format change. Blast radius is human error output for these proxy/transcript refusals. Successful operations and exit codes are unchanged.