Skip to content

fix: updates fail with one moved cron partition - #185097

Merged
RomneyDa merged 8 commits into
mainfrom
fix/cron-single-partition-upgrade
Nov 1, 2026
Merged

RomneyDa merged 8 commits into
mainfrom
fix/cron-single-partition-upgrade

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

An update rehearsal could leave a pre-v34 database without a cron default when its one retained partition still used the old state-directory path.

Behavior

  • Existing bindings and a matching current default remain authoritative.
  • If exactly one retained partition exists, the migration binds it.
  • If multiple partitions or an invalid binding exist, the update remains non-fatal: OpenClaw preserves every partition, leaves cron paused, and reports the existing warning.
  • This PR adds no setting, interactive upgrade prompt, ranking policy, or data merge.

Evidence

  • 76 focused tests passed across schema migration, historical database migration, snapshot inventory, and private update admission.
  • The selector-less multi-partition rehearsal completes private admission without creating a binding and verifies the source database remains byte-for-byte unchanged.
  • Core and test typechecks, targeted lint, and formatting pass.
  • Effective PR diff: 5 files, +36/−18. Runtime migration change: +4/−2.

Scope

Ready-for-review preparation only. Do not merge or backport.

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 26, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

The pre-v34 cron migration automatically binds a sole retained partition when its original path no longer matches.

Example: A pre-v34 database moves from /srv/old to /srv/new and retains only /srv/old/cron/jobs.json.

  • Before: Migration leaves the default cron partition unresolved.
  • After: Migration binds /srv/old/cron/jobs.json while preserving its existing records.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no definite correctness finding, but inspectable stored-state upgrade evidence is incomplete.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate does not apply to this maintainer-authored PR; the separate stored-state gate remains incomplete because the public discussion reports a detailed 2026.10.8 upgrade with runtime-equivalent migration logic, but its referenced output is no longer present and latest-stable 2026.10.9 preservation is not established.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A moved legacy installation with one retained cron partition can finish migration without making its scheduled jobs available automatically.
Reason: The maintainer explicitly approves the narrowed sole-partition behavior, which avoids a manual selection when no competing retained partition exists.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: the simplified migration addresses a remaining legacy-state case without introducing a definite code defect, and the maintainer explicitly limits it to review preparation.

Priority: P2
Reviewed head: 00682d3d7ccc555062f8adddc9ef64cefe728543

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Make the previously reported published-updater results inspectable and establish latest-stable upgrade preservation; no base-versus-head regression execution was available in this review.
Agent review details

How this fits together

Update rehearsal and database admission invoke the shared cron identity migration, which converts retained partition inventory into a durable default binding consumed by cron selection.

flowchart TD
  A[Published updater] --> B[Private state snapshot]
  B --> C[State schema migration]
  D[Original state admission] --> C
  C --> E[Retained cron inventory]
  E --> F[Durable default binding]
  F --> G[Cron selection]
Loading

Technical review

Best possible solution:

Keep the sole-partition fallback in the existing migration owner while preserving bindings, explicit selectors, and unresolved multiple-partition behavior.

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

Current-main source leaves an unmatched sole legacy partition unresolved, and the changed migration and process tests directly exercise that path; this read-only review ran no reproduction.

Is this the best way to solve the issue?

The fallback is the smallest complete fix within the existing migration owner, and every remaining test change covers migration preservation or a distinct snapshot/admission boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8b1efb47c130.

Provenance checked

  • Legacy cron default migration changes intended behavior with a stated reason (ded44cc: Preserve durable partition identity across moves while requiring explicit selection when an old location cannot establish the default.)
  • Private update admission and source selector preservation keeps the original intent (fix(update): preserve cron selection through released upgrades #185723: Keep authoritative selectors and allow cron-disabled private rehearsals to defer unresolved selection.)
  • Snapshot worker process regression changes intended behavior with a stated reason (2598134: Forward the original state/config selector into private admission instead of choosing a retained sibling.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ded44cc adds src/state/openclaw-state-db-cron-identity-migration.ts:279 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ded44ccc8e5f; files: src/state/openclaw-state-db-cron-identity-migration.ts)
  • Vincent Koc: Raw commit 6c5e220 adds src/infra/update-candidate-state.inventory.test.ts:297 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6c5e22056d96; files: src/infra/update-candidate-state.inventory.test.ts)
  • Shakker: Raw commit 2598134 adds src/infra/update-candidate-rehearsal.cron-identity.process.test.ts:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 259813419cab; files: src/infra/update-candidate-rehearsal.cron-identity.process.test.ts)

PR surface

Source +2, Tests +16. Total +18 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 4 2 +2
Tests 4 32 16 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 36 18 +18

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The change repairs cron selection for a bounded legacy migration case while ambiguous installations retain the existing non-fatal recovery path.
  • merge-risk: 🚨 compatibility: Migration now persists an automatic default for a formerly unresolved sole partition; the maintainer explicitly accepts that selection policy and continued ambiguity for multiple partitions.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore the existing upgrade output or artifact and provide applicable latest-stable preservation evidence, with sensitive values redacted.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-26T22:31:23.769Z sha 6d7e09e :: blocked before merge. :: [P2] Update the historical Doctor fixture for automatic binding
  • reviewed 2026-10-27T00:24:13.295Z sha 4649b81 :: blocked before merge. :: none
  • reviewed 2026-10-28T23:44:27.484Z sha 9ab71b9 :: blocked before merge. :: none
  • reviewed 2026-10-30T20:30:05.068Z sha 7e42b32 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-30T23:52:33.010Z sha 7b6da43 :: blocked before merge. :: none

Reviewed October 31, 2026, 5:02 AM ET / 09:02 UTC (Revision 6).

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 27, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head 7b6da436ab662eb8443a554c348666c22f202b92. This follow-up removes the normal upgrade-time partition choice: existing bindings and matching defaults remain authoritative; otherwise migration selects the partition with the most stored jobs, then retained activity, then stable path, while retaining every sibling partition and honoring explicit cron.store overrides.

88 focused tests pass, including selector-less two-partition published rehearsal coverage. Core/test typechecks, targeted lint, and formatting pass. Scope remains ready-for-review preparation only; do not merge.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 30, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review simplified head 00682d3d7ccc555062f8adddc9ef64cefe728543. The PR now keeps only the safe sole-partition fallback. Multiple or invalid partitions are preserved, update admission remains non-fatal, cron stays paused with the existing warning, and no ranking policy, setting, prompt, data merge, or published-driver harness is added.

Effective diff is 5 files (+36/−18), with a +4/−2 runtime change. 76 focused tests and core/test typecheck, targeted lint, and formatting pass. Scope is ready-for-review preparation only; do not merge.

@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation scripts Repository scripts docker Docker and sandbox tooling size: L labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@RomneyDa
RomneyDa merged commit d58d193 into main Nov 1, 2026
153 of 154 checks passed
@RomneyDa
RomneyDa deleted the fix/cron-single-partition-upgrade branch November 1, 2026 02:44
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
* fix: unblock updates with one cron partition

Co-authored-by: RomneyDa <[email protected]>

* test: cover historical cron binding upgrade

Co-authored-by: RomneyDa <[email protected]>

* test: align cron upgrade expectations

Co-authored-by: RomneyDa <[email protected]>

* test(update): prove moved cron upgrade from stable

Co-authored-by: RomneyDa <[email protected]>

* test(update): repair moved cron upgrade proof

* test(update): compare stable cron definition across runs

* fix: choose moved cron partitions during upgrade

Co-authored-by: RomneyDa <[email protected]>

* fix: keep ambiguous cron upgrades non-fatal

Co-authored-by: RomneyDa <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants