Skip to content

fix: let agents repair config when the setup helper cannot run - #200809

Merged
roboclaw-bot merged 4 commits into
openclaw:mainfrom
lastguru-net:fix/config-recovery-without-helper
Nov 18, 2026
Merged

roboclaw-bot merged 4 commits into
openclaw:mainfrom
lastguru-net:fix/config-recovery-without-helper

Conversation

@beru-ant-king

@beru-ant-king beru-ant-king commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #200779

What Problem This Solves

An agent can have working inference and permission to repair configuration while the separate setup helper's model is unavailable. Requiring that model before even presenting an exact change for approval leaves recovery stuck. The helper-only routing instruction also leaves explicitly requested ordinary local-file repair ambiguous when configuration or setup tooling is broken.

User Impact

User impact: exact config commands can reach the existing approval and configuration writer without helper inference. Explicitly requested ordinary local repairs have documented file/exec recovery guidance when the normal route is operationally unavailable.

Existing runtime approval checks still govern exact tool operations. The file-recovery guidance prohibits overriding denials or changing access, approval or ownership policies; it does not add a filesystem authorization boundary to broadly permitted file/exec tools. Existing readonly, containment and tool restrictions remain in force. No migration or new setting is required.

Why This Change Was Made

The existing command grammar and executor already provide deterministic operations. Verified inference is now prepared only when conversational work needs it; exact-command provenance stays with the existing approval owner. Model-generated proposals retain their inference checks. A helper outage does not grant authority.

The prompt explicitly describes ordinary local recovery: inspect, preserve a rollback copy, make the narrow repair, validate and read back. One model finding a way through ambiguous wording does not excuse another refusing the same authorized repair.

This is a concrete proposal for the recovery contract requested in the issue review, not a claim that the product/security decision is already approved.

Evidence

Live before/after: an isolated built Gateway and a real native Codex parent, with only the configured helper provider fault-injected to return HTTP 503. The natural-language helper control actually reached that endpoint and failed.

Baseline ea94eb3bd38e:
  exact logging command -> helper HTTP503, no approval, saved value unchanged

Candidate 8a13db0c9c37:
  exact logging command -> unchanged before allow-once, then saved debug
  ordinary file repair  -> exact backup, only requested repair, validation exit 0
  exact policy request  -> real deny, config bytes unchanged
  requested file fallback after denial -> config bytes still unchanged
  NEW exact policy request -> distinct approval ID; unchanged until allow-once;
                              autoApproveChanges=true, valid saved config

Candidate helper requests during all five parent phases: 0
Native parent input/output tokens per phase:
  8868/56, 1768/748, 499/52, 1513/103, 609/73
Live test: 1 passed; runner exit 0; disposable Gateway and runner homes removed

Each parent phase had native thread/model lifecycle, matching provider/model transcript metadata and positive usage. Approval decisions used the real operator approval.resolve path, not mocked decisions. This was an isolated Gateway test, not a Discord UI replay. The denied file-fallback observation proves that interaction, not universal filesystem enforcement.

Counterevidence retained: ordinary direct-file repair already succeeded on the baseline, including an exact backup and valid result. Its original harness failed on an incorrect expectation of universal blockage; that run was not relabeled passed. The prompt change clarifies the recovery contract rather than claiming direct repair never worked before.

Snapshot follow-up 7e83c107e368: regenerated the Telegram base prompt and Discord delta with pnpm prompt:snapshots:gen. pnpm prompt:snapshots:check reproduced both stale outputs before the fix and now passes for all six generated files. Independent diff checks confirm only the existing recovery paragraph and derived counters, hashes and offsets changed. Runtime and generator source are unchanged from live-tested 8a13db0c9c37, so its live/build evidence is reused, not claimed as a new run.

Additional verification:

  • 280 focused tests passed: engine 87, Gateway/session 62, approval 32, prompt/tool 74, stable-prefix 15, TUI 10.
  • Delegated-authority Gateway E2E passed: 1 test, 95.21 seconds total, including exact commands with helper HTTP 503. This used standalone source execution on the repository-pinned Bun runtime with verified prebuilt Gateway artifacts.
  • Core typecheck, scoped type-aware lint, formatting and diff checks passed.
  • Canonical runtime build passed at 8a13db0c9c37. Clean source, current build/runtime input signatures, Codex compiler inputs and all 188 recorded Codex output hashes were verified. Native Codex version: 0.164.0; Node: 26.13.1.
  • Fresh independent native source review found no actionable production findings; the subsequent TUI type-only correction and evidence claims were also reviewed. The standalone review CLI was unavailable; no machine-clean review status is claimed.
Failed attempts and remaining verification limits

Failed live setup attempts are retained: an unsupported baseline preload; a candidate client missing the approval-event capability; and an incorrect fixture capability import. The latter two were corrected only in the private harness, with actual import validation before the successful run. The five candidate assertions were not weakened and the reviewed candidate source stayed unchanged.

Extra E2E preparation failed in declaration generation without recoverable compiler diagnostics. The normal test wrapper's subprocess compiler then exited 137 before collection; standalone Node execution hit the Linux source-loader ownership restriction before Gateway startup. These are not passing runs or proven inherited defects. The subsequently executed pinned-Bun standalone E2E passed.

CI success, stable-version upgrade proof and exhaustive file/exec enforcement are not claimed. See the current PR checks for CI status. Production configuration and the deployed Gateway were not modified.

lastguru-net and others added 2 commits November 17, 2026 22:45
Run exact config commands through the existing approval and write owners without requiring helper inference. Preserve verified inference for conversational and model-produced work, and document bounded local file recovery for explicitly requested ordinary repairs.

Co-authored-by: Beru <[email protected]>
Keep the TUI binding required rather than inheriting the conversational engine option becoming optional. This preserves the existing terminal startup and wizard handoff contract.

Co-authored-by: Beru <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 17, 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 agents Agent runtime and tooling size: L labels Nov 17, 2026
@beru-ant-king
beru-ant-king marked this pull request as ready for review November 17, 2026 21:49
@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: ready, awaiting a maintainer decision.

What this changes

This PR lets exact config commands reach existing approval and write owners without helper inference and documents bounded local file recovery.

Example: An agent requests config set logging.level debug while the helper provider returns HTTP 503.

  • Before: Helper admission fails before approval, leaving the saved logging level unchanged.
  • After: The exact change reaches approval without helper inference and saves debug after allow-once.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong supplied runtime evidence and no identified code defect; unresolved product direction caps overall readiness.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Supplied terminal output exercises an isolated built Gateway with a real native parent, helper HTTP 503, successful exact-change approval, denied policy changes, and bounded ordinary file repair; changed production blobs match the live-tested candidate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: A working agent cannot present an exact configuration repair for approval when the separate helper's inference is unavailable.
Reason: The recovery has demonstrated value, but it changes deliberate inference admission and expands local-repair guidance without a recorded owner decision.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep open: this PR addresses a verified recovery dead end without an identified correctness defect, but its recovery contract still needs an area-owner decision.

Priority: P2
Reviewed head: 69c618e51e148a26cad4ad47a97ff83cac2769c3
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should this PR establish both inference-independent exact config commands and the bounded file/exec recovery exception?
  • Recommendation: Approve both recovery paths: Accept deterministic commands through existing approval and write owners, plus the documented ordinary local-repair exception within existing file/exec permissions.
  • Why: The original inference-first behavior was deliberate, and neither the linked issue discussion nor current PR comments approve these recovery-policy changes.

Before merge

None.

Findings

None.

Agent review details

How this fits together

The regular agent delegates to openclaw.chat, whose system-agent engine parses commands, obtains exact approval, invokes the existing configuration writer, and returns the recorded outcome.

flowchart TD
A[Regular agent] --> B[openclaw chat]
B --> C[Existing command parser]
C --> D[Exact approval owner]
D --> E[Configuration writer]
E --> F[Validation and outcome]
B --> G[Helper inference for conversation]
Loading

Technical review

Best possible solution:

Use inference-independent exact approval through the existing config writer with an owner-approved, bounded local-recovery contract.

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

Current-main source shows helper failure preceding exact-command approval, and the supplied live baseline reproduces that failure with HTTP 503; this review executed no target code.

Is this the best way to solve the issue?

The deterministic path is a focused repair using existing parser, approval, and writer owners; the ordinary local-file exception is a separate policy choice rather than a demonstrated new filesystem safeguard.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Inference-first system-agent admission changes intended behavior with a stated reason (96f0983: Verified inference was required before conversation to keep onboarding on the correct Gateway with a working model.)
  • Hosting-Gateway configuration routing changes intended behavior with a stated reason (d553516: Clarify unavailable setup tooling while preserving local ownership restrictions and separately authorized remote work.)
  • Post-write verification and repair keeps the original intent (0843b94: Keep private execution phases with their owners while preserving post-write validation and repair behavior.)
  • Delegated permission-policy approval keeps the original intent (b8980ca: Restricted or unknown effective authority requires exact approval, and broadening standing delegation cannot authorize itself.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 644e14a adds src/gateway/server-methods/system-agent.ts:436 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 644e14a6ab75; files: src/gateway/server-methods/system-agent.ts)
  • Jason O'Neal: Raw commit d553516 adds src/agents/system-prompt-control.ts:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d553516036b6; files: src/agents/system-prompt-control.ts)

PR surface

Source +162, Tests +322, Docs +17. Total +501 across 18 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 7 327 165 +162
Tests 10 394 72 +322
Docs 1 17 0 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 738 237 +501

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.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #200779
Summary: This PR is the proposed recovery implementation for the same author's open report.

Members:

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

Labels

Label changes:

  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove status: ⏳ waiting on author: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • P2: A helper-provider outage blocks an advanced agent-administration workflow while direct operator configuration remains available.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • 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 (2 earlier review cycles)
  • reviewed 2026-11-17T22:09:09.642Z sha 8a13db0 :: blocked before merge. :: [P2] Regenerate the prompt snapshots after changing control guidance
  • reviewed 2026-11-17T23:07:08.626Z sha 7e83c10 :: ready, awaiting a maintainer decision. :: none

Reviewed November 17, 2026, 7:25 PM ET / November 18, 2026, 00:25 UTC (Revision 3).

Regenerate the Telegram base and Discord delta through prompt:snapshots:gen. The snapshot check failed before regeneration and now passes for all six outputs. Runtime and generator source are unchanged.

Co-authored-by: Beru <[email protected]>
@beru-ant-king

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 18, 2026
@roboclaw-bot
roboclaw-bot merged commit 8b007e9 into openclaw:main Nov 18, 2026
252 of 254 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Mandatory setup-helper routing blocks authorized config recovery when helper inference fails

4 participants