Repository navigation
fix(doctor): preserve legacy upgrade state and diagnostics - #186506
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review Current head: |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR repairs legacy backup discovery, optional Codex lifecycle warnings, and deferred-schema Doctor diagnostics. Example: An upgrade from OpenClaw 2026.9.2 leaves state headers at 15 while canonical content reaches schema 39.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR merits landing: the three repairs preserve existing ownership boundaries, the reported conflict is resolved, and no introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor consumes legacy configuration, persisted Codex assignments, and private database snapshots to prepare backups, repair obsolete metadata, and report storage health. flowchart TD
A[Legacy installation] --> B[Doctor]
B --> C[Backup discovery projection]
C --> D[Original byte archive]
B --> E[Codex assignment repair]
B --> F[State maintenance admission]
F --> G[Database diagnostics]
Technical reviewBest possible solution: Land the focused repair using the existing backup, assignment and state-maintenance owners. Do we have a high-confidence way to reproduce the issue? Current-main source exposes all three failure paths; the submitted packaged upgrade evidence exercises the deferred-header case, while focused regressions cover heartbeat backup discovery and optional revisions. Is this the best way to solve the issue? The patch is a small complete repair: reuse validated heartbeat projection only for discovery, compare optional revisions after existing identity checks, and delegate diagnostic admission to the canonical state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fcf176cc1f60. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +26, Tests +166. Total +192 across 7 files. Added test files: 0. View PR surface stats
Review metrics
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 HistoryReview history (5 earlier review cycles)
Reviewed November 2, 2026, 6:14 AM ET / 11:14 UTC (Revision 6). |
|
@clawsweeper re-review Current head: a8866dc. Please review the complete seven-path legacy-upgrade repair: backup-only heartbeat validation with original-byte preservation, native optional-lifecycle matching after the existing identity guards, and the retained execution-policy fixture setup. Full-PR autoreview and independent owner reviews are clear; successor runtime proof is pending. Prior package failures, source-review limitations, and the separate unchanged installed-tree budget are recorded in the updated body. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head Candidate-bound R2 is now complete: https://github.com/openclaw/openclaw/actions/runs/41427083767 (attempt 1). Integrity, npm 12 installation at 46,872 entries / 596,462,015 file bytes, and both published 2026.9.2 and 2026.10.9 legacy-state upgrades passed against the same TGZ The positive 9.2 witness retained physical/metadata 15/15 with content/expected/Doctor version 39, zero pending migrations and unchanged primary database identity/bytes. The 10.9 same-version update passed exact installed application payload identity, settings/data preservation and applicable backup/rollback. Both single-attempt cells and joined cleanup passed; no omitted selected scenario or historical-result splice. The updated body links the exact jobs/artifact, distinguishes the repaired harness from the unchanged candidate, and records observer-sidecar, raw-export, truncated-text, first-hop and dependency-inventory limitations. Required CI/security and native landing remain independent gates; no waiver is requested. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…186506) * test(e2e): align legacy operator requested exec policy * fix(doctor): preserve legacy upgrade backups and native assignments * fix(doctor): retain opt-in backup discovery typing * test(doctor): compare captured file bytes directly * fix(doctor): inspect admitted state schema content * fix: refresh the reviewed correction baseline Baseline-Refresh: e20ab99aad2669c5ee844498d5e939d0a1031cd8 * test(doctor): avoid shadowing state descriptor * fix(package): restore installed entry budget (openclaw#188097) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 1864046) * fix(packaging): exclude source-build ledgers from npm packages (openclaw#190030) * fix(packaging): omit source-build ledgers from published packages Keep source-module URL metadata in build trees for source AOT compilation, while excluding it from root and separately packed AI publication. Preserve runtime resources and canonical distribution inventories. Allocate exactly 143 net regression-test lines for real npm/pnpm root and bundled-AI pack coverage, runtime exports, and inventory agreement; leave the shared baseline unchanged. * test(packaging): type fixture package names * test(packaging): complete declared publication fixture inputs * test(anthropic): cover repeated stdin failure notifications (openclaw#190335) * fix(anthropic): validate cancellation across stdin notifications * test(process): avoid returning from close promise executor * test(process): preserve typed stdin error identity (cherry picked from commit 0285717) (cherry picked from commit dcfd10f) * fix: refresh the reviewed correction baseline Baseline-Refresh: 131d3c9a10faf98d2bdb4e2b79051307c1e88f4f Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Dallin Romney <[email protected]>
Related: #177381
Problem and repair
Legacy upgrades can fail backup discovery before Doctor retires valid heartbeat configuration, emit a false unknown-lifecycle warning for imported native assignments when both optional revisions are absent, or report pending state migrations when current database contents are valid behind a deliberately deferred published header.
The repair uses the validated read-only heartbeat projection for backup discovery, preserves exact assignment identity checks, and reads canonical effective state content version with full read-only maintenance admission. Original backup bytes, writable retirement ordering, uncertain-identity refusals, strict port admission and existing snapshot ownership remain intact. No configuration surface, schema version, protocol, execution permission or publication fence changes.
Current candidate and source proof
Signed successor
fccef9e696563e4b76b1b1ad2c127dd28d892e1c, tree96b83960f21ba5d1e0024faddf187d989db00818, frozen baselinea113c483403a5e2f37a965837d600f4414333a26. The native baseline composition preserves main's batching, lazy reads and hexadecimal snapshot comparison. The original Doctor fixes remain; packaging is now baseline-identical, including the landed exclusions from #188097 and #190030.Against this baseline: seven paths; production +44/-18 (net +26) and tests +171/-5 (net +166). The production additions protect backup-only validation, optional-revision classification and canonical state-health admission. Root and AI package manifests are 2026.10.9; earlier 10.8 wording is historical and does not describe this candidate.
STOP_UNCONFIRMEDresult remains failed; a separate audited read-only native receipt confirmed exact resource disposal. No cleanup waiver or repeated resource mutation was used.Final packaged compatibility proof
R2 passed in Package Acceptance 41427083767, attempt 1. The qualified workflow harness is
04114baa735c98b950ba0195857ce7029c4734b7; the candidate remains exactfccef9e696563e4b76b1b1ad2c127dd28d892e1c/ 2026.10.9.The native artifact route reused the original candidate tarball without rebuilding it: SHA-256
0bcf8a96fda525232efd8d2843560f73e6928523ff4eabfc1c4f4fbe5e7c772f. Current artifact 13132781086, archive digestaed0f54f6e25ab9ecc476b6a9204796b0c5ad0d7fdcda5ba77281b5cd4047597, supplied integrity, npm installation and both upgrade cells.dist/*.brremain. Compared with the earlier install, npm's permittedtoken-types6.1.2→6.2.0 resolution accounts for one directory and 1,622 bytes; the TGZ did not change.The canonical harness repairs are landed in #190798 and #190878. They preserve strict identity/Doctor assertions and explicitly author the fixture's Workshop opt-out through each supported baseline schema.
Evidence limits remain explicit: the initial 9.2 observer changed sidecars; the primary database, Doctor's SQLite-family observation and subsequent observer equality passed. Raw Doctor JSON and identity files are not separately exported; their complete validation is enforced by the successful canonical assertions.
firstHopPostCoreis unavailable, some redacted text logs are truncated at 16 KiB, and dependency inventory metadata is not a full dependency-byte/SRI attestation. Structured deferred-schema and rollback receipts are complete. This is the selected two-cell proof, not a full release matrix or a claim of zero total warnings.History and remaining landing gates
Earlier fccef run 41380411856 remains failed: 9.2 reached the identity/deferred-schema phases but failed strict Doctor-clean because the old fixture left Workshop auto enabled behind a restrictive plugin policy. The fixture was repaired independently; its earlier 10.9 success is not spliced into the current aggregate. Historical dc4 package proof and the earlier 2a6112 package-budget failure remain candidate-bound history, not current credit.
Exact-fccef CI and required security/dependency status checks are successful in CI 41379977288 and enforced status publication 41382144986. Optional CodeQL is neutral and provides no full-scan claim. Fresh exact-fccef ClawSweeper review reports zero findings, nothing before merge and no remaining Rank-up moves. It correctly separates the focused optional-revision regression from the packaged upgrade scenarios. Native correction preparation passed; normal final required-check, security, overlap and squash admission remain authoritative. No CI waiver is requested.
Direct upstream contract inspection used
openai/codex@414782450952a196bbb64b1605a458c2531c47b6:codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs:135-183,codex-rs/app-server-protocol/src/protocol/v2/thread.rs:316-430,1254-1266,codex-rs/app-server/src/request_processors/thread_processor.rs:668-674,2153-2243, andcodex-rs/core/src/tools/handlers/multi_agents/spawn.rs:120-208. Lifecycle revision remains OpenClaw-owned; the upstream wire contract is unchanged.