Skip to content

chore: cover worker state in published upgrade tests - #149487

Merged
steipete merged 6 commits into
mainfrom
codex/upgrade-worker-cells
Sep 16, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/upgrade-worker-cells

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #148637, #148586

What Problem This Solves

Existing upgrade survivor cells do not exercise worker-backed Projects inventory reads or terminal task/flow restoration from published SQLite state.

User Impact

Internal validation only; no product behavior change. Both new scenarios are opt-in and remain outside aggregate defaults.

Why This Change Was Made

Adds two explicit published-updater survivor scenarios for SQLite owner migrations. projects-doctor preserves a registered project and workspace through the published 2026.9.4 updater, then runs the actual selected Doctor check twice. taskflow-restoration preserves terminal tasks/flows and verifies cold Gateway restoration, awaited task SDK reads, same-connection pagination, and complete persisted records after shutdown.

Both scenarios reuse the canonical survivor lifecycle. They pin the published writer, verify the installed candidate payload even when versions match, omit registry companion preparation, and preserve failed synthetic state for diagnosis. Runtime cleanup belongs to the outer owner after Docker has returned successfully. It removes the private runtime through the same image and default container user, with no network and only the owned mount, before the host removes the empty parent. Failed runs retain their original exit status and synthetic state. The shared Docker helper chain uses explicit child-status returns so a Linux Bash EXIT trap cannot turn a cleanup error into success. The taskflow fixture declares the existing activation.onStartup contract, and its actual manifest is covered by the real Gateway startup-planner regression.

Evidence

Source qualification includes the original 161 focused cases, the fixture activation regression, 141 planner/helper cases after the main merge, and 22 survivor-wrapper cases. The final status fix passed all 24 ordinary EXIT-trap cases under the two local Bash versions. On Linux Bash 5.2, all 12 corresponding cases failed before the fix and passed afterward; the actual cleanup caller then returned failure and retained its marker for an injected Docker error. Final selected static checks and P2 review passed.

The broad local Docker-helper run recorded 375 passed, two platform skips, and three unresolved signal/PID failures: watchdog SIGTERM, watchdog SIGHUP, and cron-runner SIGHUP readiness. Their signal handlers, PID writes, readiness loops, and budgets are unchanged; source audit identified no causal path from the return-status change, but does not establish that the failures are unrelated. These cases were not replayed locally and no deadline was changed. Fresh exact-head hosted CI passed for 8eaf9b0b63b8d85eaf793799b48508a220960993 after the status repair and main conflict resolution. This does not claim a local full-suite pass or establish the cause of those three failures.

Both published-driver cells passed on separate private Linux Testboxes with Node 24.19.0. Each used the unchanged published [email protected] updater (commit 3a9d69db306cd7f081e06254cb89c4bcc14a7107), a qualified candidate tarball, and genuine separate tooling/candidate checkouts.

  • Projects: tooling 06dc546d17642f0a3c858f83075ea4564f2898c0 with candidate ce976b93874950381ed1715bb5565238e504d186. All 23 phases passed. Both selected Doctor runs reported one check run and no findings. Complete project records, schema, and workspace sentinels were preserved; both standalone Doctor runs left config and original SQLite files byte-identical. All 9,798 installed payload records matched the candidate. Update: 42.427 seconds; selected Doctor runs: 1.158 and 1.094 seconds. Run.
  • Taskflow: tooling 1e57f31bc521fbd1376d638aaf2cd2cffbcfa52a with unchanged candidate 63cb11d8f41ce8d6eeb462d297a9632a4c5ba159. All 18 phases passed, including cold Gateway startup, 13 awaited SDK reads, two task pages (2 then 1) and three task details on one connection, and complete task/delivery/flow record equality after Gateway shutdown. All 9,778 installed payload records matched the candidate. Update: 43.458 seconds; Gateway start: 6.324 seconds; SDK/page phase: 0.375 seconds. Run.

The first taskflow application attempt exposed the fixture's missing startup declaration after update, startup, pagination, and task-detail checks had succeeded. Its evidence is retained; no product code or candidate package was changed. A separate earlier local ENOSPC stopped source preparation before upload and before application execution; the supported external cache directory resolved that transport issue. The corrected cell ran once after the reviewed fixture repair. All owned leases were stopped after private evidence and archive-hash verification. A separate synthetic Linux-volume ownership proof reproduced the original removal failure as UID 2002 against a UID 1001-owned, mode-0700 runtime. The repaired container cleanup removed the private child, UID 2002 could remove the empty parent, and the primary-failure case retained its marker and exit 42. Container cleanup and Linux parent removal were verified separately through local Docker; this was not another application upgrade cell. The task-owned volume and fixture image were removed. Both upgrade results above remain bound to their historical tooling commits. Raw artifacts remain private.

Add opt-in Projects Doctor and terminal task/flow restoration cells using the unchanged published updater, verified package bytes, and the canonical survivor lifecycle. Preserve failed synthetic state until the outer Docker owner has joined.

Validation: 161 focused tests, selected changed checks, and P2 review. Actual package upgrade cells remain separately qualified against frozen candidate artifacts.
@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 16, 2026, 12:23 AM ET / 04:23 UTC (Revision 6).

ClawSweeper review

What this changes

Adds opt-in published-upgrade tests for Projects and terminal task/flow preservation, verifies installed package bytes, and preserves Docker cleanup failures.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful validation work absent from current main. No actionable patch defects remain: the cleanup finding is resolved, and the prior generic migration-proof blocker does not apply because this PR changes test fixtures, not the product’s stored data model.

Priority: P2
Reviewed head: 8eaf9b0b63b8d85eaf793799b48508a220960993

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound harness extension with meaningful real-run evidence, repaired prior findings, and successful exact-head CI.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Reported Linux published-updater runs exercise the actual Doctor and Gateway paths with preserved records, and separate Docker observations cover cleanup ownership and failure propagation. Core fixture blobs match the historical tooling revisions; those runs qualify the harness behavior, not newer product candidates.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Reported Linux published-updater runs exercise the actual Doctor and Gateway paths with preserved records, and separate Docker observations cover cleanup ownership and failure propagation. Core fixture blobs match the historical tooling revisions; those runs qualify the harness behavior, not newer product candidates.
Evidence reviewed 9 items Reviewed introduction boundary: Inspected the introduced changes from pinned base 8432c13 to the actual PR head. Changes are confined to test tooling, tests, script registration, and documentation; no product schema, migration, or plugin API implementation changes are introduced. The supplied stale test merge was not used to infer removals.
Still needed on main: Current main's canonical scenario policy lacks both new scenarios. Their fixture entrypoints are also absent from current main and v2026.9.4. The related open PRs change product readers rather than replacing this validation harness.
Prior cleanup finding resolved: Successful runs remove the private runtime through the same image's default user, with network disabled and only the owned runtime mount. Failed runs retain state. Explicit child-status returns prevent EXIT-trap status substitution, and focused tests cover cleanup failure and retained markers.
Findings None None.
Security None None.

How this fits together

The upgrade survivor harness installs a published OpenClaw package, seeds isolated state, and runs its updater against a candidate package. It then checks Doctor or Gateway behavior and records whether state survived.

flowchart TD
  A[Published package] --> C[Seed isolated state]
  B[Candidate tarball] --> D[Run published updater]
  C --> D
  D --> E[Verify installed bytes]
  E --> F[Doctor and Gateway checks]
  F --> G[Compare preserved records]
  G --> H[Clean successful runtime or retain failure]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Tests +460, Docs +17, Other +1374. Total +1851 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 463 3 +460
Docs 1 17 0 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 13 1389 15 +1374
Total 20 1869 18 +1851

Review metrics

Metric Value Why it matters
Runtime versus validation growth Product runtime +0; test/tooling +1,834 net lines; docs +17 Growth implements two real package-upgrade scenarios and their integrity, cleanup, and regression checks without expanding product runtime.
Scenario selection 2 opt-in scenarios; 0 aggregate-default additions The added coverage does not increase normal aggregate release runs.

Stored data model

Persistent data-model change detected: migration/backfill/repair: config/knip.config.ts, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/assertions.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/projects-doctor.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/run.sh, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/taskflow-restoration-fixture.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/taskflow-restoration-plugin.mjs, and 15 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep these scenarios in the canonical survivor harness, with package-specific evidence and failed-state retention, while product migration PRs retain their own compatibility obligations.

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

Not applicable to the primary coverage addition. The body provides before/after Linux EXIT-trap failure observations; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes. Extending the existing survivor lifecycle keeps package identity, update execution, and cleanup under their existing owners without changing product schemas or APIs.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This adds useful, bounded upgrade validation and repairs cleanup status reporting without an urgent product regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Reported Linux published-updater runs exercise the actual Doctor and Gateway paths with preserved records, and separate Docker observations cover cleanup ownership and failure propagation. Core fixture blobs match the historical tooling revisions; those runs qualify the harness behavior, not newer product candidates.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported Linux published-updater runs exercise the actual Doctor and Gateway paths with preserved records, and separate Docker observations cover cleanup ownership and failure propagation. Core fixture blobs match the historical tooling revisions; those runs qualify the harness behavior, not newer product candidates.

Evidence

What I checked:

  • Reviewed introduction boundary: Inspected the introduced changes from pinned base 8432c13 to the actual PR head. Changes are confined to test tooling, tests, script registration, and documentation; no product schema, migration, or plugin API implementation changes are introduced. The supplied stale test merge was not used to infer removals. (8eaf9b0b63b8)
  • Still needed on main: Current main's canonical scenario policy lacks both new scenarios. Their fixture entrypoints are also absent from current main and v2026.9.4. The related open PRs change product readers rather than replacing this validation harness. (scripts/lib/upgrade-survivor-policy.mjs:1, e83ea6e7f095)
  • Prior cleanup finding resolved: Successful runs remove the private runtime through the same image's default user, with network disabled and only the owned runtime mount. Failed runs retain state. Explicit child-status returns prevent EXIT-trap status substitution, and focused tests cover cleanup failure and retained markers. (scripts/e2e/upgrade-survivor-docker.sh:48, 8eaf9b0b63b8)
  • Published-driver behavior evidence: The supplied complete PR body reports real Linux package runs: Projects passed 23 phases with two clean Doctor checks and unchanged SQLite/config bytes; Taskflow passed 18 phases with 13 awaited SDK reads, two task pages, and complete persisted-record equality after shutdown. Projects used tooling 06dc546 and candidate ce976b9; Taskflow used tooling 1e57f31 and candidate 63cb11d. Separate real Docker ownership and cleanup-failure observations cover the subsequent cleanup repair. These remain historical package runs, not execution of current product candidates.
  • Historical proof source continuity: Git tree entries establish identical blobs between the reported tooling revisions and this head for projects-doctor.mjs, worker-cell-package.mjs, and all three taskflow fixture modules. Historical content-diff inspection encountered an unavailable object; tree identity checks independently established equality for these five files without claiming that the entire harness was unchanged. (scripts/e2e/lib/upgrade-survivor/taskflow-restoration.mjs, 8eaf9b0b63b8)
  • CI and proof limitations: GitHub confirms https://github.com/openclaw/openclaw/actions/runs/35052949699 succeeded on the exact reviewed head. The two linked Testbox workflows ended cancelled and therefore are not independently passing CI evidence for the application runs; their job structure is consistent with the body's account of stopped leases. Raw application artifacts remain private. The body separately discloses three unresolved local signal/PID failures without claiming they are unrelated. (8eaf9b0b63b8)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-15T23:14:23.005Z sha 06dc546 :: needs real behavior proof before merge. :: [P2] [P2] Handle container ownership in outer runtime cleanup
  • reviewed 2026-09-16T00:35:00.415Z sha 1e57f31 :: blocked before merge. :: [P2] [P2] Handle container ownership in outer runtime cleanup
  • reviewed 2026-09-16T01:38:33.913Z sha 1e57f31 :: blocked before merge. :: [P2] [P2] Handle container ownership in outer runtime cleanup
  • reviewed 2026-09-16T02:26:18.202Z sha fa66813 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T03:49:30.794Z sha 8eaf9b0 :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts docker Docker and sandbox tooling size: XL maintainer Maintainer-authored PR labels Sep 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 01:32
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 16, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@steipete
steipete merged commit ec66133 into main Sep 16, 2026
92 checks passed
@steipete
steipete deleted the codex/upgrade-worker-cells branch September 16, 2026 04:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
* test: add worker state upgrade survivor cells

Add opt-in Projects Doctor and terminal task/flow restoration cells using the unchanged published updater, verified package bytes, and the canonical survivor lifecycle. Preserve failed synthetic state until the outer Docker owner has joined.

Validation: 161 focused tests, selected changed checks, and P2 review. Actual package upgrade cells remain separately qualified against frozen candidate artifacts.

* test: activate taskflow survivor fixture on Gateway startup

* test: clean worker runtime with container ownership

* fix(test): preserve Docker status through exit traps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant