Skip to content

fix(gateway): make config.patch errors name the problem and a working next step - #124127

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-config-error-text
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-config-error-text

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Three dead-end error texts in config.patch (found by the round-5 config lane), violating the never-dead-end-the-agent doctrine — failure text must state what to try next, and the advice must actually work:

  1. "invalid config; fix before patching" — the handler already holds the validation issues in the snapshot but discarded them; the operator got no idea what is invalid or how to fix it.
  2. The hashless-LWW rejection said "re-run config.get and retry" — wrong advice: retrying a hash-free patch fails identically. The operator needs to know which changed paths are outside the LWW subtree and that the retry needs baseHash.
  3. commitGatewayConfigWriteOrRespond appended "re-run config.get and retry" to every ConfigMutationConflictError, including non-retryable ones (path ownership), where the retry fails too.

Why This Change Was Made

  • The invalid-config error now reuses summarizeConfigValidationIssues — the same owner the sibling validation errors already use — attaches structured details.issues, and names openclaw doctor as the fix path. No new formatting policy.
  • The hashless-LWW rejection names the exact guarded paths (config base hash required for gateway.port; …retry with baseHash).
  • The retry suffix is gated on error.retryable (the field is the recorded fact; refactor(config): delete dead compat surfaces and write-only error payload #124067 just confirmed all consumers read it).

User Impact

Operators and agents hitting config.patch failures see the actual issues and a next step that works, instead of a generic rejection or advice that loops.

Evidence

  • Two new regression tests, both fail pre-fix (stash proof): mixed hash-free patch error names the guarded path; non-retryable conflict omits the retry advice.
  • node scripts/run-vitest.mjs run src/gateway/server-methods/config.test.ts — 26/26.
  • pnpm tsgo, pnpm check:test-types, oxfmt/oxlint clean; autoreview clean (0.99).

Production LOC +18/−9 (error-content growth is the point — the texts now carry the recorded facts); tests +30/−5.

…ng next step

Three dead-end error texts in config.patch, per the never-dead-end-the-agent
doctrine (failure text states what to try next):

- "invalid config; fix before patching" hid the actual validation issues the
  handler already had in the snapshot; it now summarizes them (same
  summarizeConfigValidationIssues owner the sibling validation errors use),
  attaches structured details, and names openclaw doctor as the fix path.
- The hashless-LWW rejection said "re-run config.get and retry" — wrong
  advice, since retrying hash-free fails identically; it now names the exact
  guarded paths and says to retry with baseHash.
- The mutation-conflict handler appended "re-run config.get and retry" to
  every conflict; non-retryable conflicts (path ownership) fail the retry
  too, so the suffix is now gated on error.retryable.

Both new regression tests fail pre-fix.
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 15, 2026 09:10
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:16 AM ET / 09:16 UTC.

ClawSweeper review

What this changes

The PR makes Gateway config.patch errors include invalid-config details, list paths that require a base hash, and advise retries only for retryable write conflicts.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a focused, correct Gateway repair for three current-main dead-end responses. Likely related people: steipete (high confidence).

Priority: P2
Reviewed head: 17b84b3e7fcf166a1dfc115dc3ec3d7ddd2e0d24

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a clean, focused repair with relevant regression coverage; exact-head CI remains the normal landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored Gateway PR is exempt from the external-contributor real-behavior-proof gate; its focused harness coverage remains supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored Gateway PR is exempt from the external-contributor real-behavior-proof gate; its focused harness coverage remains supplemental validation.
Evidence reviewed 6 items Current-main behavior: Current main still appends retry advice to every mutation conflict, discards invalid snapshot issues, and gives hashless mixed patches no guarded-path detail.
Patch uses the existing owner boundary: The branch changes the config.patch response producer, reuses the existing validation summarizer, and does not introduce a parallel error formatter.
Conflict retry contract: retryable is the authoritative fact: it defaults to true and is explicitly false for non-retryable write conflicts.
Findings None None.
Security None None.

How this fits together

Gateway config.patch accepts an operator’s partial configuration change, validates and merges it, then commits it or returns a structured error. Its response text and details guide gateway clients toward a valid repair or retry.

flowchart LR
  A[Gateway client patch request] --> B[Read configuration snapshot]
  B --> C[Merge and validate patch]
  C --> D[Write configuration]
  B --> E[Invalid configuration response]
  C --> F[Base hash or conflict response]
  D --> G[Success response]
Loading

Before merge

  • Resolve merge risk (P2) - Production code grows by 10 net lines for a bug fix; the added facts are localized to the existing response owner and reuse existing summary and error-shape helpers.
  • Complete next step (P2) - No repair-lane action is needed: this maintainer-owned PR has no actionable review finding.
Agent review details

Security

None.

PR surface

Source +10, Tests +25. Total +35 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 3 +10
Tests 1 27 2 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 40 5 +35

Review metrics

Metric Value Why it matters
Production versus test LOC production +13/-3 (net +10); tests +27/-2 (net +25) The production growth is limited to actionable error content and an existing structured-details field; the test growth covers the two previously misleading outcomes.
Gateway error response 1 validation response enriched; 2 retry-guidance paths corrected The patch changes operator-visible failure guidance without adding configuration keys, defaults, or protocol parameters.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/gateway/server-methods/config.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Complete exact-head CI, then retain this direct owner-boundary repair; no net-neutral refactor would preserve the necessary messages and structured validation details.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Complete exact-head CI, then retain this direct owner-boundary repair; no net-neutral refactor would preserve the necessary messages and structured validation details.

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

Yes—there is a high-confidence deterministic handler-harness path for the mixed hashless patch and non-retryable conflict cases; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes—the patch changes the response producer itself, uses the canonical validation summarizer and recorded retryable fact, and avoids text parsing or a downstream workaround.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fe5fa802fa27.

Labels

Label changes:

  • add P2: This is a bounded operator-facing Gateway error-path repair with no evidence of data loss, availability failure, or a shipped default-path outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored Gateway PR is exempt from the external-contributor real-behavior-proof gate; its focused harness coverage remains supplemental validation.

Label justifications:

  • P2: This is a bounded operator-facing Gateway error-path repair with no evidence of data loss, availability failure, or a shipped default-path outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored Gateway PR is exempt from the external-contributor real-behavior-proof gate; its focused harness coverage remains supplemental validation.

Evidence

What I checked:

Likely related people:

  • steipete: Git blame attributes the three current response sites to the prior merged Gateway change, and the related merged configuration refactor also carries this owner’s history. (role: introduced and recently maintained the Gateway configuration path; confidence: high; commits: 2adbdd75c6f8, f1ced37ce5df; files: src/gateway/server-methods/config.ts, src/gateway/server-methods/config.test.ts, src/config/mutation-conflict.ts)

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.

@steipete
steipete merged commit 02d34aa into main Aug 15, 2026
254 checks passed
@steipete
steipete deleted the codex/autoqa-config-error-text branch August 15, 2026 09:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…ng next step (openclaw#124127)

Three dead-end error texts in config.patch, per the never-dead-end-the-agent
doctrine (failure text states what to try next):

- "invalid config; fix before patching" hid the actual validation issues the
  handler already had in the snapshot; it now summarizes them (same
  summarizeConfigValidationIssues owner the sibling validation errors use),
  attaches structured details, and names openclaw doctor as the fix path.
- The hashless-LWW rejection said "re-run config.get and retry" — wrong
  advice, since retrying hash-free fails identically; it now names the exact
  guarded paths and says to retry with baseHash.
- The mutation-conflict handler appended "re-run config.get and retry" to
  every conflict; non-retryable conflicts (path ownership) fail the retry
  too, so the suffix is now gated on error.retryable.

Both new regression tests fail pre-fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant