Repository navigation
fix(gateway): make config.patch errors name the problem and a working next step - #124127
Conversation
…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.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:16 AM ET / 09:16 UTC. ClawSweeper reviewWhat this changesThe PR makes Gateway Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: this is a focused, correct Gateway repair for three current-main dead-end responses. Likely related people: steipete (high confidence). Priority: P2 Review scores
Verification
How this fits togetherGateway 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +25. Total +35 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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 AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fe5fa802fa27. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…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.
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:"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."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 needsbaseHash.commitGatewayConfigWriteOrRespondappended"re-run config.get and retry"to everyConfigMutationConflictError, including non-retryable ones (path ownership), where the retry fails too.Why This Change Was Made
summarizeConfigValidationIssues— the same owner the sibling validation errors already use — attaches structureddetails.issues, and namesopenclaw doctoras the fix path. No new formatting policy.config base hash required for gateway.port; …retry with baseHash).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
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.