Repository navigation
fix(doctor): keep a valid reseeded config that lacks meta - #183703
Conversation
After the documented Kubernetes reseed, a valid openclaw.json without a meta block was classified as clobbered (missing-meta-vs-last-good) and doctor --fix restored the previous last-good config, keeping the operator's new file only as openclaw.json.clobbered.<ts>. Missing meta alone is no longer clobber evidence: doctor keeps the valid file, stamps meta, refreshes last-good and reports the repair. Truncated or invalid files still restore, with a warning naming the saved original and how to undo it. Fixes #183641. Thanks @csabatatrai.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
|
Codex review: blocked before merge. What this changesThis PR preserves valid metadata-free configurations, makes Doctor stamp their metadata and refresh recovery backups, and adds actionable restore warnings. Example: A Kubernetes reseed replaces gateway.port 19091 with 19092 in a valid configuration without meta.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: it addresses a confirmed configuration-recovery bug, but the new metadata repair causes five Doctor consumer-test failures that need updating. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared config observer classifies suspicious reads, recovery restores eligible backups, and Doctor persists validated repairs through the existing guarded config writer. flowchart TD
A[ConfigMap reseed] --> B[Config snapshot]
B --> C[Shared suspicion detector]
C --> D[Backup recovery]
C --> E[Doctor repair planner]
E --> F[Guarded config writer]
F --> G[Last-good promotion]
Technical reviewBest possible solution: Keep the shared detector fix and existing guarded persistence owners, update the affected consumer fixtures, and qualify preservation of existing installations. Do we have a high-confidence way to reproduce the issue? The released-version report and current-main detector-to-recovery path establish the failure; this read-only review ran no target code. Is this the best way to solve the issue? Removing metadata absence at the shared detector fixes the cause for all consumers while retaining stronger clobber signals; the small receipt cleanup reuses the existing canonical owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3d83f96a4f25. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +9, Tests +34, Docs +7. Total +50 across 10 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel 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 Reviewed October 25, 2026, 12:35 PM ET / 16:35 UTC. |
Drop the extra Doctor meta stamping and last-good refresh: the Gateway already promotes an accepted config to last-good after startup, and stamping every hand-written config made Doctor report a repair for valid configs. Restore the session-store owner confirmation and config path fallback that the previous commit removed by accident.
…83703) After the documented Kubernetes reseed, a valid openclaw.json without a meta block was classified as clobbered (missing-meta-vs-last-good) and doctor --fix restored the previous last-good config, keeping the operator's new file only as openclaw.json.clobbered.<ts>, so the Gateway silently ran the old configuration. Missing meta alone is no longer clobber evidence, so the valid reseed is kept and the Gateway promotes it to last-good after starting. Size-drop and missing gateway.mode checks still trigger recovery, and every restore warning now names the preserved original and how to undo it. Fixes openclaw#183641. Thanks @csabatatrai for the report.
After the documented Kubernetes reseed, a valid openclaw.json without a meta block was classified as clobbered (missing-meta-vs-last-good) and doctor --fix restored the previous last-good config, keeping the operator's new file only as openclaw.json.clobbered.<ts>, so the Gateway silently ran the old configuration. Missing meta alone is no longer clobber evidence, so the valid reseed is kept and the Gateway promotes it to last-good after starting. Size-drop and missing gateway.mode checks still trigger recovery, and every restore warning now names the preserved original and how to undo it. Fixes #183641. Thanks @csabatatrai for the report. Release adaptation: the baseline has no io.observe-promotion.ts or io.snapshot.promotion.test.ts; last-known-good promotion lives in io.observe-recovery.ts, so the hasMeta plumbing was removed there instead. The doctor regression test was ported into the baseline describe block without the main-only helpers (await using, withHome). (cherry picked from commit 159c14a)
…ed semantics Bedrock Responses routing cases used the shared discovery cache key, so the default-region case read a cached result. #179471 no longer fails updates on an unavailable channel, #183703 no longer treats missing meta as clobber evidence, #180174 downgrades a missing legacy OAuth dir to a warning, and #180280 leaves untimed 429s without a cooldown; their stale expectations are updated to match main. The #183390 media case is wrapped in the stable harness shape, and the Codex ownership harness now reports the original owner's thread as loaded until it exits, as the app server does.
After the documented Kubernetes reseed, a valid openclaw.json without a meta block was classified as clobbered (missing-meta-vs-last-good) and doctor --fix restored the previous last-good config, keeping the operator's new file only as openclaw.json.clobbered.<ts>, so the Gateway silently ran the old configuration. Missing meta alone is no longer clobber evidence, so the valid reseed is kept and the Gateway promotes it to last-good after starting. Size-drop and missing gateway.mode checks still trigger recovery, and every restore warning now names the preserved original and how to undo it. Fixes #183641. Thanks @csabatatrai for the report. (cherry picked from commit 159c14a) Adapted for 2026.9.x: ported only the core removal of the missing-meta-vs-last-good reason (io.observe-suspicious.ts plus its two 9.x callers in io.observe-suspicious.ts and io.observe.ts dropping the hasMeta argument). The restore-warning wording change in io.observe-recovery.ts and the io.observe-promotion.ts / io.snapshot.promotion.test.ts parts are not ported; the Kubernetes doc paragraph omits the sentence about that warning. The 9.x test that asserted recovery from a meta-less config ("recovery uses canonical metadata fingerprints") is replaced by a regression that keeps the valid meta-less config.
What Problem This Solves
Fixes #183641. After the documented Kubernetes reseed (
docs/install/kubernetes.md), the persistedopenclaw.jsonis deleted and the init container copies a valid ConfigMap version that has nometablock. The nextopenclaw doctor --fixreportsConfig auto-restored from backup: … (missing-meta-vs-last-good), puts the previous last-good config back, and keeps the operator's new file only asopenclaw.json.clobbered.<timestamp>. The Gateway then runs the old configuration with no error. The image entrypoint runsdoctor --fixbefore everygatewaystart, so every reseed hits this when that entrypoint is used; with the official manifest it hits whenever Doctor runs later, for example during an upgrade.Why This Change Was Made
A missing
metablock alone is not evidence that the file was clobbered. The shared clobber detector no longer treats it as one, so Doctor keeps a valid reseeded file as is, and the Gateway promotes it to last-good after a successful start (existing behavior insrc/gateway/server-startup-finish.ts). The real protections stay: a large size drop or a missinggateway.modestill triggers recovery, and invalid files still restore. Any restore now warns with the path of the preserved original and how to undo it, so a restore is never silent. The Kubernetes reseed docs are updated to match.User Impact
Operators who reseed config from a ConfigMap keep the configuration they deployed. Doctor no longer silently swaps it for the previous one during startup or upgrades.
Evidence
.bakring present, valid meta-less replacement): Doctor keeps it unchanged with no.clobberedfile, the meta-less config can be promoted to last-good, and a later invalid config still restores with the undo warning. It fails on main (verified by reverting the detector change).doctor-config-flow,io.observe-recoveryandio.snapshot.promotiontests pass on Node; the Doctor config-flow files also pass under Bun.Thanks @csabatatrai for the precise report and workaround.
Review Notes
src/commands/doctor-config-flow.ts:167-174) was against 25aa585. Head 0f79666 removes that metadata repair entirely, sodoctor-config-flow.tsmatchesmainand its fixtures pass unchanged (46/46 on Node, also green under Bun)..bakring present, valid meta-less file) and the later invalid-config recovery.