Skip to content

fix: stop recommending onboarding for OpenClaw runtime failures - #166234

Merged
obviyus merged 1 commit into
openclaw:mainfrom
PollyBot13:fix/system-agent-failure-guidance-139710
Oct 7, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
PollyBot13:fix/system-agent-failure-guidance-139710

Conversation

@PollyBot13

@PollyBot13 PollyBot13 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139710. Also covers the misleading recovery advice consolidated from #166138.

What Problem This Solves

Fixes OpenClaw helper failures recommending openclaw onboard when a verified route is healthy but a turn times out, its runtime becomes unavailable, or its verified route changes.

User Impact

Users get failure-specific retry, log, route-verification, or compatible-runtime guidance instead of being told to rerun onboarding for unrelated runtime failures. A missing verified binding still recommends setup.

Why This Change Was Made

Existing failure producers know whether setup is missing, a request failed, a turn timed out, an owner could not admit the runtime, or route revalidation failed. This change passes that distinction to the existing bounded public error formatter. Broad owner-not-published failures are not falsely described as definitely superseded.

This is only the guidance half of #139710: it does not retry stale generations or change runtime admission, routing, CLI restrictions, approvals, or failed-turn cleanup. The admission repair is a separate focused candidate.

Evidence

  • The new terminal assertions failed on baseline in all 13 intended cases because the message contained openclaw onboard. Final focused producer/cleanup tests: 84/84 passed through the maintained wrapper.
  • Built-Gateway differential on Node 24.21.0 with disposable HOME/state, authenticated operator WebSocket client, synthetic loopback OpenAI-compatible provider, and actual model-emitted openclaw calls (not a mocked runner): the stable same-agent control completes; patching the same caller session to a non-default bundled litellm provider reproduces pre-dispatch helper admission failure on both baseline and this guidance-only candidate. The candidate changes the advice without masking the failure.
  • Actual model-route drift remains fail-closed. A synthetic model maxTokens hot reload prevents a second helper dispatch; guidance now recommends a new conversation to verify the route, not onboarding.
  • Independent adversarial native review completed with no unresolved P0–P2 findings; preserved typed error code/stage/failures, 300-character cause bound, state cleanup and existing guards. Upstream CLI autoreview was attempted but unavailable (HTTP401), and is not claimed as review coverage.
  • Full changed-file check passed: core types, all 27 core-test type graphs, lint/format, ratchets, dead-export scans, runtime cycles and security-store guards.
  • Runtime build: maintained build-all.mts qaRuntime passed; declaration/release packaging is not claimed.
Redacted Gateway observations and reproduction shape

Fixture uses the repository's maintained test-instance, Gateway client and Responses SSE helpers. The provider serves configured synthetic models with fixture-only keys; no production provider or service is used. Configured helper route is openai/proof-default; only the same main calling session is patched to litellm/proof-override. The selected non-startup provider creates a different run generation; normal caller inference still succeeds.

baseline c10679395819ede78bb073f979f95c157e165bfa
  stable helper: 2 provider requests; gateway_status returned to caller
  overridden caller: helper provider requests=0; tool status=error
  error: OpenClaw could not reach working inference. Run `openclaw onboard` ...
  cause: prepared model runtime plugin generation was superseded for <agent-dir>

guidance-only candidate, identical synthetic scenario
  stable helper: 2 provider requests; gateway_status returned to caller
  overridden caller: helper provider requests=0; tool status=error
  error: The prepared inference runtime became unavailable or was superseded during this turn.
         Try again; if it persists, check the model runtime logs.
  cause: prepared model runtime plugin generation was superseded for <agent-dir>

verified model-route drift after config hot reload
  second helper provider requests=0; tool status=error
  error: The verified inference route changed or could not be reverified during this turn.
         Start a new OpenClaw conversation to verify the current route.

all runs: client/Gateway/provider closed; disposable state removed

Top-level agent.wait can return ok when the caller reports a tool error; evidence above uses actual tool output and provider dispatch counts, not that misleading aggregate. Gateway proof production source bytes are unchanged by the final test-only catch-annotation lint correction.

One-worker test cost and completed CI timing

Exact head: 199f28459514fdb0eb5108638ad41af743cdedcd. Measured on macOS with Node 24.21.0, existing dependencies, one file per sequential invocation of pnpm test src/system-agent/<file> --maxWorkers=1. These are end-to-end command wall times, including the maintained wrapper, compiler/import preparation, and cleanup—not just test-body execution. All six files passed (84 tests total); no new worker pin or serial configuration was added.

Materially changed test file One-worker wall time Result
agent-turn.terminal.test.ts 27.77 s passed
agent-turn.test.ts 18.75 s passed
assistant.configured.test.ts 22.47 s passed
chat-engine.test.ts 17.91 s passed
system-agent.test.ts 19.15 s passed
tui-backend.test.ts 18.03 s passed

Completed original-head CI run: 511 s elapsed from run creation to completion. All 24 selected Node test jobs passed; their summed job wall time was 4,428 runner-seconds, including setup/cleanup and unchanged tests in their shared shards (not an incremental cost attributable to this patch). The checks-node-changed and checks-node-changed-boundary jobs took 363 s and 96 s, respectively. Local per-file timings above isolate the changed files; CI job timings do not.

Original-head CI was not green: security-fast failed its production dependency audit on GHSA-6qxp-vccf-f47h in unchanged MCP dependencies; the check-run and status-context openclaw/ci-gate failures propagate that same leaf failure. This PR changes no package manifest, lockfile, or audit policy. Source, test, type, and lint jobs passed; no audit bypass or speculative dependency repair is included.

CI baseline refresh — October 7

Rebased the unchanged patch from 199f28459514fdb0eb5108638ad41af743cdedcd onto main 0d06bc0fec0129608ed04ed286e7e1e2c28021e3, which includes the merged MCP dependency repair #166217. Refreshed head: 8e636124a56216cab59b59e059be04260704dd76. An independent Astra review verified identical per-parent patches and every PR-owned source/test blob, with no refresh-induced finding. No manifest, lockfile or audit-policy change is added by this PR.

  • The production audit against the refreshed lockfile reports no matching high-or-higher npm bulk advisories; this is not comprehensive vulnerability clearance.
  • Supported node scripts/run-vitest.mjs focused regressions/controls: 84/84 passed (45.03 s). These local runs reuse the pre-refresh installed SDK 1.30.1/fs-safe 0.24.0 snapshot and supplement source validation, not clean-install compatibility. Hosted CI must validate the tracked SDK 1.31.0/fs-safe 0.24.1 dependencies.
  • Earlier Gateway traces and per-file timing evidence above are historical, source-identical proof, not a new current-head E2E replay. Fresh exact-head hosted CI and ClawSweeper review remain pending.

Owner acceptance: one failure-guidance change across existing producers and their tests; no runtime policy or persistent-data migration. Rollback is reverting this patch. It does not claim to fix every reload/retained-work failure or close #139710 alone.

AI-assisted: implementation and independent review assisted by Codex.

@clawsweeper

clawsweeper Bot commented Oct 6, 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.

@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 2:14 AM ET / 06:14 UTC (Revision 3).

ClawSweeper review

What this changes

OpenClaw’s setup and repair helper gives failure-specific recovery advice while preserving onboarding guidance when verified inference is missing.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main and v2026.9.8 still recommend onboarding for unrelated runtime failures. No blocking correctness finding remains, and the recorded Gateway differential provides sufficient behavior proof.

Priority: P2
Reviewed head: 8e636124a56216cab59b59e059be04260704dd76

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with meaningful Gateway differential proof and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Recorded built-Gateway helper calls exercise the changed turn-error owner and formatter: runtime admission failure receives runtime-specific advice, and route drift rejects another dispatch with conversation-reverification advice. Historical proof is explicitly reported as source-identical after rebase; independent old-head comparison was unavailable. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Recorded built-Gateway helper calls exercise the changed turn-error owner and formatter: runtime admission failure receives runtime-specific advice, and route drift rejects another dispatch with conversation-reverification advice. Historical proof is explicitly reported as source-identical after rebase; independent old-head comparison was unavailable. No stored-data contract changes.
Evidence reviewed 7 items Pinned introduced patch: Reviewed the merge-base-to-head delta. Producers select guidance from existing failure facts; admission, dispatch restrictions, route guards, and cleanup remain intact.
Current main still needs the change: The current-main formatter still uses one onboarding message for all inference failures.
Latest release remains affected: The supplied latest-release commit also contains the generic onboarding remedy.
Findings None None.
Security None None.

How this fits together

The setup and repair helper runs user requests through a verified model route. Its turn, planner, CLI, and chat owners report failures through a shared public error formatter.

flowchart TD
  A[User repair request] --> B[Verified model route]
  B --> C[Helper turn or planner]
  C --> D[Failure classification]
  D --> E[Shared error formatter]
  E --> F[Recovery guidance]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +84, Tests +114. Total +198 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 7 110 26 +84
Tests 6 163 49 +114
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 273 75 +198

Review metrics

Metric Value Why it matters
Production versus test growth production net +84 lines; tests net +114 lines Production growth implements typed guidance selection across existing producers; regression coverage protects those separate failure boundaries.

Technical review

Best possible solution:

Keep recovery advice tied to producer-known failure facts through the existing formatter, with runtime admission repair tracked separately.

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

Yes: current-main source maps runtime failures to the onboarding message, and the supplied Gateway differential demonstrates that mismatch through actual helper calls. This review did not execute target code.

Is this the best way to solve the issue?

Yes: selecting guidance at existing failure producers preserves the shared formatter and avoids changing runtime admission, routing, or approval policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5d4484b6ba69.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This bounded recovery-guidance repair prevents unnecessary onboarding without changing runtime availability or policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Recorded built-Gateway helper calls exercise the changed turn-error owner and formatter: runtime admission failure receives runtime-specific advice, and route drift rejects another dispatch with conversation-reverification advice. Historical proof is explicitly reported as source-identical after rebase; independent old-head comparison was unavailable. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded built-Gateway helper calls exercise the changed turn-error owner and formatter: runtime admission failure receives runtime-specific advice, and route drift rejects another dispatch with conversation-reverification advice. Historical proof is explicitly reported as source-identical after rebase; independent old-head comparison was unavailable. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jesse Merhi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-06T18:10:24.218Z sha 199f28459514fdb0eb5108638ad41af743cdedcd :: needs changes before merge. :: none
  • reviewed 2026-10-06T18:25:39.147Z sha 199f28459514fdb0eb5108638ad41af743cdedcd :: needs maintainer review before merge. :: none

@PollyBot13

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body now records measured one-worker command wall times for all six materially changed test files (84 tests passed on the unchanged reviewed head), plus the completed current-head CI elapsed time and summed Node test-job seconds. The production dependency audit and its two propagated gate failures are explicitly separated from the passing source/test/type/lint jobs. No source, dependency, or CI-policy changes were made.

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@PollyBot13
PollyBot13 force-pushed the fix/system-agent-failure-guidance-139710 branch from 199f284 to 8e63612 Compare October 7, 2026 06:07
@obviyus

obviyus commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Validated exact head 8e636124a56216cab59b59e059be04260704dd76 in isolated Node 24.21.0 Docker with a freshly built Gateway and a loopback Responses provider. No source changes were needed.

  • All six changed test files passed: 84/84. With the seven production files reverted to the PR parent while retaining the candidate tests, all six files failed as expected: 29 failing assertions, 55 passing tests.
  • Real agent RPC → model-emitted openclaw delegation → helper inference: an intentionally stalled helper response timed out. Baseline guidance was: “OpenClaw could not reach working inference. Run openclaw onboard on the machine running OpenClaw to reconnect — it live-tests the route before saving it. Then try again.” Candidate guidance was: “The inference request timed out. Try again; if it persists, check the model runtime and its timeout settings.” Both included the cause: “Request timed out before a response was generated. Please try again, or increase agents.defaults.timeoutSeconds in your config.”
  • After a benign inventory reload while the caller remained admitted, the next helper turn hit the unavailable/superseded runtime. Baseline again recommended onboarding. Candidate text was: “The prepared inference runtime became unavailable or was superseded during this turn. Try again; if it persists, check the model runtime logs.” The cause remained the superseded prepared plugin generation. The helper stayed rejected; this PR changes advice, not admission.
  • Exact-head live gate passed through the built CLI with real gpt-5-mini, reasoning low, output budget 4096; returned live gate ready.
  • Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/37579973357 (no failed or cancelled jobs). ClawSweeper's existing exact-head review is ready.

This guidance change and #166235 touch disjoint files and merge cleanly; this PR can land independently.

@obviyus
obviyus merged commit e991632 into openclaw:main Oct 7, 2026
132 of 134 checks passed
@obviyus

obviyus commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Landed in e991632. Thanks @PollyBot13! Verified on a built Gateway: helper timeouts and an unavailable/superseded runtime now give failure-specific guidance instead of telling users to run openclaw onboard.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
…claw#166234)

Give the OpenClaw helper failure-specific recovery guidance (retry, logs, route verification, compatible runtime) when a verified route is healthy but a turn times out, its runtime becomes unavailable, or its route changes, instead of recommending openclaw onboard.

Related: openclaw#139710

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

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

2 participants