Repository navigation
Conversation
…hout flattening Configure writeback was flattening or refusing $include-owned agent entries and provider catalogs when the same persist also changed root auth or allowlists.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
openclaw/src/config/io.write.ts
Lines 748 to 755 in fa02648
When finalizeRuntimeSnapshotWrite fails, src/config/io.runtime.ts:675-701 rolls the root config back and invokes this compensation hook, but the hook restores only audit and warning state. Any keyed agent or catalog files written earlier therefore retain their new values while the root returns to its old bytes, leaving disk and runtime in a mixed revision after a post-commit refresh failure; the include writes need guarded compensation in this rollback path as well.
AGENTS.md reference: AGENTS.md:L95-L96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesThis PR saves mixed root settings, include-owned agent entries, and provider catalogs while preserving their authored include directives. Example: Add qwen3 to models.json5 while updating the Ollama API key and root model allowlist.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a current mixed-owner config-write failure, resolves the previous backup-warning finding, and has no remaining actionable findings from this review. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI, Doctor, and Gateway config mutations enter the shared config writer, which validates the combined configuration, publishes owned files, and supplies guarded rollback and runtime-activation results. flowchart TD
A[CLI Doctor or Gateway mutation] --> B[Shared config writer]
B --> C[Resolve ownership and stage includes]
C --> D[Validate combined configuration]
D --> E[Guarded include publication]
E --> F[Root publication and runtime activation]
E --> G[Conditional compensation]
F --> G
Technical reviewBest possible solution: Land the shared-writer repair with its existing authority, conditional compensation, and accepted interruption-recovery contract after required CI passes. Do we have a high-confidence way to reproduce the issue? The linked report gives a concrete mixed catalog/root patch, current main retains the refusing ownership path, and supplied stable-release CLI captures report the same refusal; no target code was executed during this read-only review. Is this the best way to solve the issue? The implementation addresses the shared persistence boundary, reuses existing target I/O and publication guards, and preserves the maintainer-approved recovery tradeoff without adding configuration options. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd56ab1a54c8. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +863, Tests +2581, Docs +20, Other +1. Total +3465 across 18 files. Added test files: 5. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (39 earlier review cycles; latest 8 shown)
Reviewed November 2, 2026, 2:19 PM ET / 19:19 UTC (Revision 40). |
Mixed root+include persists staged the include bytes to disk before validation and preflight, from resolved config values, with no lock, hash fence, batch unwinding, post-commit rollback, or per-effect authority asserts. Include publication now has one owner, src/config/include-write-through.ts: stage in memory, validate and hash the staged bytes through an include read overlay, publish inside the guarded commit window before the root under a per-target lock with a hash fence and incremental restorers, restore-only-if-unchanged on failure including runtime-finalization rollback, and project staged values onto the authored include so env-var references survive. mutate.ts imports the shared primitives instead of private copies. Docs state the bounded contract.
…ilde findings Pass the caller's live authority when acquiring the include write lock so an authorized mixed save can publish. Track the copy-fallback removal before publish() can throw and register a null-content restorer for it. Authorize include restoration on the original source owner instead of active config selection. Preserve authored tilde paths in staged agent-entry includes.
…n copy-fallback failure, align doctor docs Post-commit include rollback now authorizes on the caller-supplied assertCurrent (the outer, still-live lock guard) instead of sourceGuard, which is scoped to createConfigIO's nested lock and already closed by rollback time under an ambient guarded owner (mutation flows). The copy-fallback removal-then-throw path now force-restores the pre-publish bytes instead of comparing against a committed hash no partial recreate can match. Doctor docs no longer claim mixed root/include repairs are refused as a whole.
… the target Remove the H3 forceRestore/force bypass: it restored unconditionally, so a writer that saved newer content in the gap between a failed include publish and restoration running had its save clobbered. The catch under the still-held per-target lock now captures the actual post-failure state of the target (missing, or whatever the copy fallback partially recreated) as the restorer's committed hash. Restoration proceeds only if the file still matches that captured damage; a concurrent save after the failure makes the fence miss and survives untouched.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Not planned. |
What Problem This Solves
CONFIG_INCLUDE_OWNERSHIP.User Impact
$includepointers,${VAR}references, and authored tilde paths.skipOutputLogssuppresses output.Why This Change Was Made
Evidence
Head:
78c5ad6653ab5e674e14721cbf127de9502affe7.Real CLI backup-failure captures below use an immutable included-catalog backup. Fixture paths are replaced by
<state>; final JSON lines report driver checks of persisted files and backup bytes.Baseline:
The warning includes
openclaw backup create --verify; the mixed save succeeds, the immutable backup remains intact, and the unlocked control creates the current backup without a warning.The new regression fails on
4e5df281b9928a8425b4f884c905cae52cbc4388because the warning is absent. It also checks persisted root/include values, path-free output, and suppression for silent writes.Retained-state CLI checks use the same config, includes, and workspace files across the published and candidate binaries. Candidate client-credential preparation uses
doctor --client-credentials --fix --non-interactive --json.Commands:
config validate --json, mixedconfig patch --file, invalidconfig patch --file, thenconfig validate --json. The invalid patch retains existing model IDs and fails thebaseUrlschema check.The following assertion-driver output wraps real CLI calls; booleans report persisted JSON and SHA-256 checks of config, backups, and workspace files. Each banner comes from the invoked binary.
Published
2026.10.6before:2026.10.6state:2026.10.9before:2026.10.9state:$includedirectives,${PR_MODEL_NAME}, tilde workspace paths, the primary model, and workspace file bytes. Invalid writes leave config files and backups unchanged.pnpm test src/config/config.backup-rotation.test.ts src/config/include-write-through.publish.test.ts --maxWorkers=1.--maxWorkers=1; wall times include command preparation.src/config/config.backup-rotation.test.ts,src/config/include-write-through.publish.test.tssrc/config/include-write-through.test.tssrc/config/include-write-through.restore-authority.test.tssrc/config/include-write-through.runtime-fence.test.tssrc/cli/update-cli/update-command-mixed-include-rollback.test.tssrc/gateway/server.config-security-policy.test.tspnpm build: exit 0 at this head, 131.96 s; CSS/chat-boot asset budgets report nonfatal violations.Closes #150353