Conversation
When openclaw CLI is not installed on the local machine, the guidance system (小龙虾建议) was sending the error to zeroclaw for diagnosis. Since zeroclaw itself requires the openclaw binary, it would either fail silently or hallucinate a wrong diagnosis (e.g. REGISTRY_CORRUPT about ~/.openclaw/openclaw.json). Fix: detect 'openclaw binary missing' errors for local transport early in explain_operation_error() and return deterministic guidance that correctly tells the user openclaw is not installed, with actionable steps (install docs link, or skip local and use SSH remote instead). Changes: - agent_fallback.rs: add fast-path in explain_operation_error for local transport + openclaw missing; add local_openclaw_not_installed_guidance function with clear install/remote-alternative guidance - guidance.ts: recognize the new guidance message in isAlreadyExplainedGuidanceError to prevent double-reporting Closes #46
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae6180e93c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ], | ||
| structured_actions: vec![GuidanceAction { | ||
| label: "查看安装文档".to_string(), | ||
| action_type: "link".to_string(), |
There was a problem hiding this comment.
Use supported actionType for install-doc CTA
This guidance now emits action_type: "link", but the frontend only supports "inline_fix" | "doctor_handoff" for GuidanceAction (src/lib/types.ts:244) and GuidanceCard routes any non-inline_fix action to doctor handoff (src/components/GuidanceCard.tsx:64-77). In the local-openclaw-missing path, the button labeled “查看安装文档” will therefore open Doctor instead of the docs URL, so users still miss the intended installation guidance.
Useful? React with 👍 / 👎.
Keith-CY
left a comment
There was a problem hiding this comment.
LGTM — fast-path guidance for missing local OpenClaw binary is correct and avoids zeroclaw misdiagnosis. No blocking issues found. CI already passes.
Co-authored-by: dev01lay2 <dev01lay2@users.noreply.github.com> Closes #46
Summary
Fixes #46 — 当本地未安装 OpenClaw CLI 时,「小龙虾建议」错误地显示 REGISTRY_CORRUPT 诊断。
Root Cause
explain_operation_error()对 local transport 的 "openclaw binary missing" 错误没有 fast path。错误被送到 zeroclaw LLM 做诊断,但 zeroclaw 本身也依赖 openclaw 二进制,导致产生错误的诊断(hallucinated REGISTRY_CORRUPT)。Changes
src-tauri/src/agent_fallback.rsexplain_operation_error()中为 local transport + openclaw missing 添加 fast path,跳过 LLM 调用local_openclaw_not_installed_guidance()函数,返回正确的引导信息:src/lib/guidance.tsisAlreadyExplainedGuidanceError()中识别新的引导消息,防止重复弹窗Before / After
Before: 小龙虾建议显示 "REGISTRY_CORRUPT: ~/.openclaw/openclaw.json contains JSON5 syntax error"(错误且不可操作)
After: 小龙虾建议显示 "本机未安装 OpenClaw CLI",提供安装文档链接和远程实例替代方案(正确且可操作)