Skip to content

feat: explain pasted errors in Ask OpenClaw - #205382

Merged
daniel-lxs merged 3 commits into
mainfrom
openclaw/ask-openclaw-explain-errors
Nov 27, 2026
Merged

daniel-lxs merged 3 commits into
mainfrom
openclaw/ask-openclaw-explain-errors

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #205372

What Problem This Solves

When an OpenClaw command fails, the error can leave you unsure what to do next. Asking a model for help is particularly difficult when model setup or the local config is what failed.

User Impact

In a ready Ask OpenClaw chat or the setup TUI, type explain error: followed by a redacted error line. On the command line, use openclaw setup --explain-error 'OpenClaw config is invalid' for local guidance. Add --json for a single reply field. This mode does not require a model or a valid config. Existing scripts using setup --message keep their inference check, exit status and JSON output.

Why This Change Was Made

One catalog provides a likely cause and one safe next step for recognized errors. It does not run the suggested command. A dedicated CLI flag keeps offline help separate from inference-backed messages. In chat, the explicit prefix treats the paste as data rather than a request to execute it. The server saves a placeholder, but the client may display the original: remove private values before sending.

Evidence

  • CrabBox AWS main comparison: with no configured model, main 5aa4b8d4d291 and candidate 760f11519bfd both exited 1 for setup --json --message 'explain error:' with identical error, guidance, ok: false and status: "unavailable" values.
  • Final-head AWS run: 58e176e006a0 matched that main output. With a configured but unreachable model, ordinary and prefixed messages both exited 1 and returned identical timeout JSON. With a working loopback fixture, the prefixed message exited 0 and returned the original overview shape, not a reply object.
  • With malformed JSON on disk, --message retained its exit-1 cli_error; --explain-error exited 0 in both plain and JSON modes and suggested openclaw config validate. Combining the offline flag with --wizard failed. An offline-flag spelling passed as the value of -m remained a normal message.
  • The final runtime build and 73 focused tests passed. The final-head check did not use an external inference provider or rerun the browser and TUI flows. Compatibility repair and verification with @daniel-lxs.

Worked on by

Work sessions

Linked for team reference; these sessions aren’t public.

🦞 Made with OpenClaw

Worked on by:
- @TheAngryPit

Co-authored-by: TheAngryPit <[email protected]>
OpenClaw-Publication: 677a842f-76c1-44f1-9b7f-597b23655b2b
@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations size: M labels Nov 25, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 25, 2026 14:11
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR adds local explanations for explicitly pasted errors in Ask OpenClaw, the setup TUI, and a new CLI flag.

Example: With malformed config and no working model, run openclaw setup --explain-error 'OpenClaw config is invalid' --json.

  • Before: Setup has no offline error-explanation flag.
  • After: The command returns a reply suggesting openclaw config validate without requiring inference.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful additive behavior with concrete supplied CLI evidence, focused boundary coverage, and no identified blocking defect; reported checks support the review but were not rerun here.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR records final-head shipped-CLI results showing offline explanations succeed with malformed config while ordinary messages preserve inference failures and JSON shape; retained Gateway evidence covers paste omission, and the chat/TUI interception paths are unchanged from the earlier reviewed head. Linked CrabBox artifacts could not be inspected here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: People may need help understanding an error while broken model setup prevents conversational assistance.
Reason: Maintainer authorship establishes direction, and the bounded explanation path provides recovery guidance without executing commands or adding persistent settings.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it adds useful, maintainer-directed offline troubleshooting that current main lacks, and no blocking defect was identified.

Reviewed head: 58e176e006a0db149af85b49890822efe83c2cff

Before merge

None.

Findings

None.

Agent review details

How this fits together

The system agent handles setup and repair conversations; explicit error input now reaches a shared local catalog that returns fixed guidance, while chat history receives a placeholder.

flowchart TD
  A[Offline CLI flag] --> C[Shared error catalog]
  B[TUI or Gateway chat] --> D[Chat engine]
  D --> C
  C --> E[Fixed guidance]
  D --> F[Sanitized history]
  D --> G[Existing conversation handling]
Loading

Technical review

Best possible solution:

Keep one bounded local catalog shared by the explicit CLI flag and chat prefix while preserving ordinary inference, approval, and transcript contracts.

Do we have a high-confidence way to reproduce the issue?

This is an additive feature; current-main source confirms the missing offline explanation path, and the PR reports concrete final-head CLI behavior.

Is this the best way to solve the issue?

A shared catalog of explicit error signatures fits model-free guidance, declines unknown or conflicting input, and preserves normal setup-message behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9fe717fea3d4.

Provenance checked

  • Inference admission keeps the original intent (96f0983: Conversational setup requires verified inference; the new dedicated offline flag preserves that prerequisite for ordinary messages.)
  • Inference-independent recovery keeps the original intent (8b007e9: Exact config recovery remains available when helper inference cannot run; the added explanation path performs no repair or approval.)
  • History ownership and redaction keeps the original intent (6e85110: Concept modules preserve the chat-engine facade and existing behavior; the history extraction retains its append, seed, read, and clear semantics.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the supplied merge-base-to-head diff, including CLI routing, the shared catalog, history handling, documentation, and every changed test. (58e176e006a0)
  • Presentation-only chat path: Explicit human error pastes are handled before wizard, approval, and inference dispatch; delegated sessions retain their existing behavior. (src/system-agent/chat-engine.ts:236, 58e176e006a0)
  • Explicit offline CLI mode: The new flag returns fixed guidance before setup config reads and rejects other setup actions; ordinary messages retain the existing inference entry point. (src/cli/program/register.setup.ts:96, 58e176e006a0)
  • Existing persistence boundary preserved: Gateway persistence consumes sanitized engine history through the existing transcript writer; role, text, timestamp, storage scope, and retention remain unchanged. (src/gateway/server-methods/system-agent-chat-turn.ts:142, 58e176e006a0)
  • Current main still lacks this capability: Fetched main retains ordinary inference admission and has no explicit pasted-error branch in the chat engine or offline flag in setup registration. (src/system-agent/chat-engine.ts:235, 9fe717fea3d4)
  • Supplied runtime evidence: The current PR body records final-head CLI outcomes for malformed config, unavailable and unreachable inference, preserved message JSON, and conflicting flags; it credits daniel-lxs for compatibility verification. (58e176e006a0)

PR surface

Source +181, Tests +126, Docs +23. Total +330 across 16 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 8 226 45 +181
Tests 5 127 1 +126
Docs 3 24 1 +23
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 377 47 +330

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
New CLI option 1 --explain-error &lt;text> provides explicit offline guidance and accepts the existing --json output control.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-25T14:28:47.063Z sha 2be13b6 :: passed. :: none

Reviewed November 27, 2026, 5:46 PM ET / 22:46 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Nov 27, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs
daniel-lxs merged commit cafab68 into main Nov 27, 2026
135 checks passed
@daniel-lxs
daniel-lxs deleted the openclaw/ask-openclaw-explain-errors branch November 27, 2026 23:09
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
Add guidance for explicitly pasted errors in Ask OpenClaw and the setup TUI. Add an offline setup flag that explains recognized errors before reading config and keeps ordinary setup messages inference-backed.

Co-authored-by: TheAngryPit <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 677a842f-76c1-44f1-9b7f-597b23655b2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

3 participants