Skip to content

fix(agents): preserve actionable public failure guidance - #163538

Merged
vincentkoc merged 1 commit into
mainfrom
fix-actionable-public-failure-guidance
Oct 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix-actionable-public-failure-guidance

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: disconnected or outdated local runtime workers lose their actionable recovery guidance when private diagnostics are converted to public failure copy.

Related: #162917

User Impact

Users get bounded next steps for a disconnected Codex node, an outdated device worker, or an offline runner, while raw node, provider, and transport diagnostics remain private.

Why This Change Was Made

The public-copy owner only received untyped error facts, so local coordination failures collapsed to generic wording. Stable producer codes now survive through the existing non-provider coordination classifier and select fixed public messages.

Provider provenance is structurally gated: a provider error carrying runner-offline, node_runner_update_required, or codex_node_disconnected still receives generic provider copy.

Current main already owns concise withdrawn-model and Telegram provider-failure copy. This PR aligns the remaining withdrawn-model assertion and adds exact private-log/public-redaction proof for Telegram. It inspects but does not adopt #146659's older verbose semantics.

Ownership and scope

  • Owner: src/agents/failover/assistant-request-failure-copy.ts plus the existing runtime-coordination classifier.
  • Producers: Codex node disconnect and node-runner inventory admission.
  • Siblings: all three inventory throw sites use the same typed factory; offline runner retains its existing typed error.
  • Production LOC: +69/-11 (net +58).
  • Test LOC: +87/-10 (net +77).
  • Repair Doctrine: remaining production growth is limited to two typed producer errors, one shared inventory factory, one central provenance gate, and three fixed messages. It removes raw-string inference and retains one public-copy owner.
  • Dependencies and lockfiles are unchanged. /allow-dependencies-change is not needed.

Exact-Head Evidence

  • Head: e8efa9a285f92a3d3e8ec0f70e2076fd01f69ab9
  • Tree: b7a28c6c75439c9f2dcfbd91fa7b2567a511079d
  • Base: 0845ecda906f2465f7cb6422e7cec8c7223f2ce9

Focused native tests

node scripts/run-vitest.mjs src/agents/failover/assistant-request-failure-copy.test.ts src/agents/failover/user-copy.test.ts src/agents/failover/failover-classification.corpus.test.ts src/agents/failover-error.test.ts src/auto-reply/reply/agent-runner-failure-reply.test.ts src/infra/node-runner-inventory.test.ts extensions/codex/src/app-server/sandbox-exec-server-node-relay.test.ts src/gateway/server-methods/models-dispatch.catalog.integration.test.ts

  • 850 tests passed across five native Vitest configurations in 69.68s.
  • Provider-code spoof regression covers all three local codes and proves provider errors remain generic.

Four-scenario boundary QA

Executed unchanged with --maxWorkers=1 in a task-owned local container:

  • Provider: local-container
  • Lease: cbx_dcf6fe939e56 (stopped cleanly)
  • Run: run_43a356cf435747ef83d404ed4ae0fcb5
  • Immutable image: sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2
  • Exact head/tree assertions and clean-worktree assertion passed before Vitest.
  • Result: 4 files passed, 5 tests passed.
  • Vitest duration: 486.60s. Command duration: 20m11.165s. Total run: 23m39.312s (23m48.561s end to end).

Scenario results:

  • Codex disconnect: 1 passed, 98.380s.
  • Update-required worker: 1 passed, 99.793s.
  • Offline runner lifecycle: 2 passed, 205.475s.
  • Telegram provider failure settlement: 1 passed, 40.559s.

Telegram privacy proof asserts that the exact provider diagnostic is retained in private Gateway logs while the public reply contains neither the full raw detail nor its independent canary.

Static gates

  • AutoReview P0-P2: exact-head scoped clean, no findings; patch correct at confidence 0.77.
  • Core production/test, extension production/test, and root QA test type lanes: passed.
  • Targeted core and extension Oxlint: passed.
  • Targeted Oxfmt: passed.
  • git diff --check: passed.
  • Changed checks: conflict-marker and line-cap gates passed. The lane stops only at the inherited current-main env-var ratchet (477 > 476); this diff adds no OPENCLAW_* variable.
  • Former wrapper-closure failure: focused regression passed on the refreshed base.
  • Exact-head hosted CI: green, including openclaw/ci-gate.

Landing

  • ClawSweeper Revision 7: exact-head ready, no findings, no before-merge items; proof sufficient.
  • Exact-head CI: green.
  • Native scripts/pr review validated at the exact head. Squash landed as 3c5010ebfacd96e6b4836c9080e58ab42c1ac7ab; retained receipt OID a7d155685d7665b486664f57e23daf101823fd28.

@clawsweeper

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

@vincentkoc vincentkoc self-assigned this Oct 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: S labels Oct 2, 2026
@steipete

steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Source review of 5cc3ef6df259c11a649122b9ed185acec9aebed6 supports this fix for three independently observed native failures at 8760d53a64cea6c0ed4ec56dfac7f74ef10689d7:

The failed head and its CI main parent a1566b2dbfde0e9f1511cc97d756aec3a36fda78 have identical failure-copy owners, error producers, agent-job.ts, and all three test files. The regression follows #163381's removal of raw diagnostic text from the Control UI fallback renderer.

This patch supplies the missing update-required identity at all three inventory throw sites, preserves the existing typed offline error through coordination classification, and selects fixed public messages. The selected copy does not interpolate node IDs, provider bodies, transport details, or raw error messages; a provider error carrying only the same code does not qualify. The existing public E2E recovery assertions remain intact. I found no actionable source issue for these three flows.

This is source attribution and review, not candidate execution proof. I did not run this head's tests or native QA; the pending exact-head QA remains pending.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 11:51 AM ET / 15:51 UTC (Revision 7).

ClawSweeper review

What this changes

The branch preserves typed local-worker failures, renders fixed recovery guidance, and strengthens coverage that keeps private diagnostics out of public replies.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main lacks the update-required and offline recovery guidance, and current-head boundary QA resolves the earlier proof gap. No actionable patch defect remains.

Priority: P2
Reviewed head: e8efa9a285f92a3d3e8ec0f70e2076fd01f69ab9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent repair with strong current-head boundary evidence and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Reported exact-head container QA exercises the real Gateway/node failure boundaries and observes actionable settlement for disconnect, update-required, and offline cases. The Telegram HTTP fixture additionally verifies private diagnostic retention and public redaction; it is not a live Telegram claim. No stored-data contract changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Reported exact-head container QA exercises the real Gateway/node failure boundaries and observes actionable settlement for disconnect, update-required, and offline cases. The Telegram HTTP fixture additionally verifies private diagnostic retention and public redaction; it is not a live Telegram claim. No stored-data contract changes require migration proof.
Evidence reviewed 10 items Pinned patch ownership: Reviewed the verified merge-base-to-head delta. Changes add error identities, classification, bounded public messages, and regression assertions; they do not alter worker authorization, protocol versions, dependencies, or persisted state.
Central public-copy owner: Three fixed messages require the existing non-provider coordination classification. The reply formatter consumes this result before generic failure copy; provider-code negative cases retain provider wording without exposing diagnostics.
Complete producer cutover: All three inventory throw sites use the shared typed factory. The Codex relay changes only its OpenClaw-owned disconnect error identity; relay framing and Codex protocol handling remain unchanged, so this repair does not depend on a changed Codex contract.
Findings None None.
Security None None.

How this fits together

OpenClaw’s failure formatter converts agent and worker errors into replies for chat and Gateway clients. Local error producers supply diagnostic facts; the formatter selects public guidance while retaining private details for logs.

flowchart TD
  A[Worker or node failure] --> B[Typed local error]
  C[Provider failure] --> D[Failure classification]
  B --> D
  D --> E[Public guidance formatter]
  E --> F[Chat and Gateway replies]
  A --> G[Private diagnostic logs]
  C --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +58, Tests +77. Total +135 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 8 69 11 +58
Tests 7 87 10 +77
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 156 21 +135

Review metrics

Metric Value Why it matters
Production versus test growth production +69/-11 (net +58); tests +87/-10 (net +77) The body justifies production growth through typed producer errors and one central public-copy path.

Technical review

Best possible solution:

Keep runtime recovery guidance in the shared public-copy owner, selected from producer facts while private diagnostics remain available in logs.

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

Yes, source inspection identifies the missing typed update/offline guidance, and existing Gateway boundary scenarios exercise those failures. This reviewer did not run a current-main reproduction.

Is this the best way to solve the issue?

Yes. Typed producer facts reuse the existing coordination classifier and public-copy owner, with coverage that rejects provider-code spoofing and preserves diagnostic privacy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 14fd53f8f69b.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs bounded recovery guidance for failed local-worker turns without changing execution 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 (live_output): Reported exact-head container QA exercises the real Gateway/node failure boundaries and observes actionable settlement for disconnect, update-required, and offline cases. The Telegram HTTP fixture additionally verifies private diagnostic retention and public redaction; it is not a live Telegram claim. No stored-data contract changes require migration proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported exact-head container QA exercises the real Gateway/node failure boundaries and observes actionable settlement for disconnect, update-required, and offline cases. The Telegram HTTP fixture additionally verifies private diagnostic retention and public redaction; it is not a live Telegram claim. No stored-data contract changes require migration proof.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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 (6 earlier review cycles)
  • reviewed 2026-10-02T13:15:06.088Z sha 5cc3ef6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T13:20:24.812Z sha 5cc3ef6 :: needs changes before merge. :: none
  • reviewed 2026-10-02T13:47:39.993Z sha 6b225e3 :: needs changes before merge. :: none
  • reviewed 2026-10-02T14:14:14.771Z sha 9b272e3 :: needs changes before merge. :: none
  • reviewed 2026-10-02T15:15:44.493Z sha 9b272e3 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T15:25:46.687Z sha e8efa9a :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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 2, 2026
@vincentkoc
vincentkoc force-pushed the fix-actionable-public-failure-guidance branch 2 times, most recently from 6b225e3 to 9b272e3 Compare October 2, 2026 14:01
@vincentkoc

Copy link
Copy Markdown
Member Author

Current-head boundary QA is complete for 9b272e30e71d3da1b7bb115dce61e16d0200e973 (tree 35a33d4c9cb999ad657a19d44a4473f012df67b7).

The unchanged four-file command ran with --maxWorkers=1 in task-owned local-container lease cbx_e6542a5ca4da using immutable image sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2.

Result: 4 files passed, 5 tests passed in 526.40s:

  • Codex disconnect: 1 passed.
  • Update-required worker: 1 passed.
  • Offline runner lifecycle: 2 passed.
  • Telegram private-log/public-redaction: 1 passed.

The Telegram assertion proves the exact private provider diagnostic remains in Gateway logs while neither the full detail nor its independent canary appears in public replies. The PR body now records the exact command receipt, timings, LOC, and Repair Doctrine justification.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc marked this pull request as ready for review October 2, 2026 15:09
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. labels Oct 2, 2026
@vincentkoc
vincentkoc force-pushed the fix-actionable-public-failure-guidance branch from 9b272e3 to e8efa9a Compare October 2, 2026 15:19
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Current-head boundary QA is complete for e8efa9a285f92a3d3e8ec0f70e2076fd01f69ab9 (tree b7a28c6c75439c9f2dcfbd91fa7b2567a511079d).

  • Local-container lease cbx_dcf6fe939e56, run run_43a356cf435747ef83d404ed4ae0fcb5, immutable image sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2; lease stopped cleanly.
  • Exact head, tree, and clean-worktree assertions passed before Vitest.
  • Four requested scenario files passed with --maxWorkers=1: 4 files, 5 tests, 486.60s Vitest.
  • Codex disconnect: 1 passed in 98.380s.
  • Update-required worker: 1 passed in 99.793s.
  • Offline runner lifecycle: 2 passed in 205.475s.
  • Telegram provider settlement: 1 passed in 40.559s. The test proves the exact provider diagnostic remains in private Gateway logs while the public reply excludes both the raw detail and its independent canary.
  • Focused owner suite: 850 tests passed across five native configs in 69.68s, including negative provider-spoof coverage for runner-offline, node_runner_update_required, and codex_node_disconnected.
  • Exact-head hosted CI is green, including openclaw/ci-gate.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 3c5010e into main Oct 2, 2026
146 checks passed
@vincentkoc
vincentkoc deleted the fix-actionable-public-failure-guidance branch October 2, 2026 15:53
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 2, 2026
The actionable guidance added in #163538 imported failover classification
from the presentation copy module. That brought provider/plugin runtime
ownership into history readers and lifecycle projections, and broke cron
suite collection through the same import chain.

Classify runtime coordination in the existing failure-reply owner and pass
only its code to the leaf renderer. Preserve the no-code short-circuit,
classification precedence, public guidance, and provider-code collision
checks. Boundary expectations and lifecycle mocks remain unchanged.

Validation: history/lifecycle import guards, 934 failover tests, 28 failure
copy tests, 28 reply tests, 94 projection tests, and 10 sibling import
assertions passed. Core typecheck, focused lint, and autoreview passed.
Cron now collects, but its cold standalone diagnostic run still exceeded
the existing 120-second case deadline; retain that harness follow-up.
Full build and broad changed-check scans were interrupted on the loaded
host. Runtime worker builds completed; no source or timeout workarounds.

Test cost: OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=1800000 node scripts/run-vitest.mjs src/agents/failover/assistant-request-failure-copy.test.ts --maxWorkers=1 --fsModuleCache=false: 267.75s wall, 28 passed, on the loaded macOS host.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
The actionable guidance added in openclaw#163538 imported failover classification
from the presentation copy module. That brought provider/plugin runtime
ownership into history readers and lifecycle projections, and broke cron
suite collection through the same import chain.

Classify runtime coordination in the existing failure-reply owner and pass
only its code to the leaf renderer. Preserve the no-code short-circuit,
classification precedence, public guidance, and provider-code collision
checks. Boundary expectations and lifecycle mocks remain unchanged.

Validation: history/lifecycle import guards, 934 failover tests, 28 failure
copy tests, 28 reply tests, 94 projection tests, and 10 sibling import
assertions passed. Core typecheck, focused lint, and autoreview passed.
Cron now collects, but its cold standalone diagnostic run still exceeded
the existing 120-second case deadline; retain that harness follow-up.
Full build and broad changed-check scans were interrupted on the loaded
host. Runtime worker builds completed; no source or timeout workarounds.

Test cost: OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=1800000 node scripts/run-vitest.mjs src/agents/failover/assistant-request-failure-copy.test.ts --maxWorkers=1 --fsModuleCache=false: 267.75s wall, 28 passed, on the loaded macOS host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: codex gateway Gateway runtime 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: S 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