Repository navigation
chore: cover worker state in published upgrade tests - #149487
Conversation
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.
|
🦞👀 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: blocked before merge. Reviewed September 16, 2026, 12:23 AM ET / 04:23 UTC (Revision 6). ClawSweeper reviewWhat this changesAdds 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 Review scores
Verification
How this fits togetherThe 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]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +460, Docs +17, Other +1374. Total +1851 across 20 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Merged via squash.
|
* 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
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-doctorpreserves a registered project and workspace through the published 2026.9.4 updater, then runs the actual selected Doctor check twice.taskflow-restorationpreserves 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.onStartupcontract, 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
8eaf9b0b63b8d85eaf793799b48508a220960993after 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 (commit3a9d69db306cd7f081e06254cb89c4bcc14a7107), a qualified candidate tarball, and genuine separate tooling/candidate checkouts.06dc546d17642f0a3c858f83075ea4564f2898c0with candidatece976b93874950381ed1715bb5565238e504d186. 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.1e57f31bc521fbd1376d638aaf2cd2cffbcfa52awith unchanged candidate63cb11d8f41ce8d6eeb462d297a9632a4c5ba159. 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
ENOSPCstopped 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.