Skip to content

fix(cli): preserve existing proxy and transcript error reasons - #191295

Merged
obviyus merged 3 commits into
mainfrom
fix/cli-existing-diagnostics
Nov 2, 2026
Merged

obviyus merged 3 commits into
mainfrom
fix/cli-existing-diagnostics

Conversation

@obviyus

@obviyus obviyus commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

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 run without a child command and proxy blob with an unknown id.
  • transcripts show and transcripts path with 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 throwExpectedCliError owner, 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 e8f91361abfe44ab7b0155fa5a4bf60f343eebc3 and candidate in secretless Linux arm64 Node 24.22.1 Docker, with isolated profiles and synthetic transcript/capture state.

  • Each of the six failure paths: main twice prints the generic root failure; candidate twice prints the existing specific reason. All exit 1.
  • Six controls across all four runs retain exit 0, clean stderr and identical output after normalizing only isolated fixture paths and generated summary timestamps: successful child command, captured blob, summary show/path, and no-summary JSON inspection.
  • 49 focused tests passed across proxy runtime, transcript CLI and failure-output owner. The updated existing transcript regression fails on main's missing expected-output contract. Targeted Oxlint/Oxfmt passed.
  • Simplification reused the existing transcript regression and removed duplicate classification cases. Production +8/-6 (net +2), tests +1/-1 (net 0), docs +7/-0 against the merge base.

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.

@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@obviyus

obviyus commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

Built-CLI diagnostic sweep proof

Head: dd017d89edbf3bf30eaafbcf767177278dbd0066. Baseline main: e8f91361abfe44ab7b0155fa5a4bf60f343eebc3.

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 86c75742b6597db3f674b4a417bd7e7dd0ca345e and 1a9382f84784963b99a26c35e68392c02879a688; author credit retained.

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 comparison

Independently built runtime artifacts in secretless Linux arm64 node:24.22.1 Docker. Every CLI invocation uses its own task profile, home, state/config and synthetic persisted fixtures, with the resolved SQLite path checked under that task state. Fixture setup writes a manual transcript session with a summary, one without a summary, and a captured payload through existing storage APIs; the disputed command/error owners are exercised only through the built CLI.

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.

Command Candidate stderr (both repeats)
proxy run -- proxy run requires a command after --
proxy blob --id missing-blob Unknown blob: missing-blob
transcripts show missing-session transcripts session not found: missing-session
transcripts path missing-session transcripts session not found: missing-session
transcripts show active-session (no summary) summary.md not found for transcripts session: active-session
transcripts path active-session (no summary) summary.md not found for transcripts session: active-session

Captured baseline stderr example:

[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw --profile <task-profile> doctor`.

proxy blob additionally emits the same existing JSON failure envelope on stdout before and after; only the human stderr classification changes:

{"ok":false,"error":{"type":"cli_error","message":"Unknown blob: missing-blob"}}

Identical controls

All four runs pass all six controls, exit 0, and retain clean stderr:

  • proxy run -- node -e 'console.log("diagnostic-success-control")': identical child stdout.
  • proxy blob --id <seeded-id>: identical synthetic captured payload bytes.
  • transcripts show summary-session: identical exported Markdown after normalizing only the independently generated fixture timestamp.
  • transcripts path summary-session: same summary artifact path relative to each isolated fixture root.
  • transcripts show active-session --json: same session projection, summary: null.
  • transcripts path active-session --json: same path projection, exists: false.

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 simplification

49 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.

@obviyus

obviyus commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: XS labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes six proxy and transcript failures display their existing specific reasons through the shared CLI error renderer.

Example: Run openclaw transcripts path missing-session.

  • Before: The CLI prints a generic command failure and suggests Doctor.
  • After: The CLI prints transcripts session not found: missing-session and retains exit status 1.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with shipped CLI comparisons, a retained regression, preserved ownership, and no identified defects.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The reviewed-head proof comment exercises the built proxy and transcript CLI commands in isolated secretless Linux Docker, showing all six specific diagnostics with exit 1 and unchanged successful operations, blob bytes, exports, and JSON controls.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users cannot distinguish a missing command, unknown capture blob, missing transcript session, or absent summary from a broken CLI installation.
Reason: Displaying the already-authored diagnostic restores understandable failure behavior, and the maintainer-authored direction adds no configuration or public contract.

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
Reviewed head: dd017d89edbf3bf30eaafbcf767177278dbd0066

Before merge

None.

Findings

None.

Agent review details

How this fits together

Commander 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]
Loading

Technical review

Best 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

  • Transcript missing-session and missing-summary refusals keeps the original intent (07694c6: The original meeting-notes CLI rejected unresolved sessions and unavailable summaries; the later move into core retained those conditions.)
  • Transcript path rejection and JSON inspection keeps the original intent (fix(cli): reject nonexistent transcript summary paths #128589: Reject nonexistent plain-text summary paths while preserving JSON availability inspection.)
  • Inline transcript command construction keeps the original intent (refactor: consolidate one-consumer internal surfaces #180786: Consolidate single-consumer command construction in its existing owner while preserving public behavior.)
  • Proxy command and blob refusals keeps the original intent (958c34e: The proxy capture CLI rejected empty child commands and unknown blobs; subsequent worker and state-owner refactors retained those refusals.)
  • Existing transcript regression keeps the original intent (test(agents,cli,discord,infra,tts,ui): remove low-value tests (batch d246) #175943: Consolidate fixture and assertion plumbing while retaining the missing-summary and JSON inspection contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ab7663d adds src/cli/program/register.transcripts.ts:84 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ab7663d438f7; files: src/cli/program/register.transcripts.ts)
  • Tak Hoffman: Raw commit 958c34e adds src/cli/proxy-cli.runtime.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 958c34e82cdb; files: src/cli/proxy-cli.runtime.ts)

PR surface

Source +2, Tests 0, Docs +7. Total +9 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 8 6 +2
Tests 1 1 1 0
Docs 2 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 16 7 +9

Root-cause cluster

Relationship: canonical
Canonical: #191295
Summary: This PR consolidates two narrower patches for existing CLI errors being classified as unexpected failures.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Expected transcript and proxy failures currently hide their specific causes, creating avoidable troubleshooting work without breaking successful operations.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Expected transcript and proxy failures currently hide their specific causes, creating avoidable troubleshooting work without breaking successful operations.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 2, 2026, 11:54 AM ET / 16:54 UTC.

@obviyus
obviyus merged commit fced905 into main Nov 2, 2026
137 checks passed
@obviyus
obviyus deleted the fix/cli-existing-diagnostics branch November 2, 2026 17:09
@obviyus

obviyus commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in fced905. Thanks @yxshee. These CLI commands now show their specific error instead of a generic failure.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…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]>
obviyus added a commit that referenced this pull request Nov 3, 2026
… 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants