Repository navigation
chore: keep the Gateway restart handoff test in step with restart markers - #201590
Conversation
…claw#200533 openclaw#200533 moved accepted queued input onto its pending rows, so the restart-resume marker no longer carries queuedInputIds. It keeps the interrupted requester as operatorSource, which restart resume revalidates. Assert that shape, and drop an unused journal field.
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR updates the Gateway restart handoff test to assert the persisted requester instead of the retired queued-input list. Example: Six local operator turns are interrupted during a planned Gateway restart.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this focused test repair follows the intentional restart-marker contract, and exact-head CI passes. No actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Linux process test starts a Gateway, interrupts active work, and inspects shutdown receipts and persisted session markers used by startup recovery. flowchart LR
A[Authenticated operator] --> B[Running Gateway sessions]
B --> C[Planned shutdown]
C --> D[Persisted restart markers]
D --> E[Handoff test assertions]
D --> F[Startup requester recovery]
Technical reviewBest possible solution: Merge the focused assertion repair while preserving the existing shutdown timing, receipt, lease, and session-persistence checks. Do we have a high-confidence way to reproduce the issue? Current main requires queuedInputIds in the test although the production writer and marker type omit it; the reported mismatch is directly supported by source. Is this the best way to solve the issue? The replacement checks the requester's persisted identity through the existing process test without restoring retired queue ownership or weakening shutdown assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5724f9518219. Provenance checked
SecurityNone. EvidenceWhat I checked:
PR surfaceTests +9. Total +9 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 18, 2026, 10:18 PM ET / November 19, 2026, 03:18 UTC. |
|
Merged via squash.
|
…claw#200533 (openclaw#201590) openclaw#200533 moved accepted queued input onto its pending rows, so the restart-resume marker no longer carries queuedInputIds. It keeps the interrupted requester as operatorSource, which restart resume revalidates. Assert that shape, and drop an unused journal field.
Related: #200533, #200394
What Problem This Solves
The Linux-only Gateway restart handoff test fails on every pull request whose changed-file CI lane selects it (
checks-node-changed), soopenclaw/ci-gateis red for changes that have nothing to do with sessions. The test still expects each interrupted session's restart marker to carry an empty queued-input list. Production stopped writing that list on purpose in #200533.User Impact
User impact: no user-visible change. Pull requests that select this test get a green CI gate again, and the test once more checks what a planned restart actually records.
Why This Change Was Made
#200533 (
703c82d20c5) moved accepted queued input onto its own pending rows, which startup replays in order. Since then the restart-resume marker (resumeAfterRestart) is documented as "running root-session resume only; accepted queued input owns its own durable row". Its type has onlyoperatorSourceandscope, and #200533's own tests stopped seedingqueuedInputIds. #200394 addedoperatorSource, the interrupted requester. Restart resume (src/gateway/session-restart-resume.ts) revalidates that source before it admits the replacement turn. Restart discovery only checks that a marker exists.The test kept asserting
resumeAfterRestart: { queuedInputIds: [] }. Here a real Gateway interrupts six pending turns for an authenticated local backend operator, and the marker it now writes is{ operatorSource: { kind: "gateway", snapshot: { profileId: "gateway-owner", localOperator: true, … } } }. The test now asserts that marker, the part of the contract restart resume depends on, instead of the removed list.gateway-owneris the protocol constantGATEWAY_OWNER_PROFILE_ID.Test file audit (whole file): one Linux-only test. Every import and constant is used, the fixture owns its temp plugin directory, provider, instance and client, and the cleanup callbacks close each of them. The
journalhelper copied acheckfield into each row that nothing read; it is removed. Nothing else is removed, skipped or loosened.Evidence
The test runs only on Linux (
it.skipIf(process.platform !== "linux")), so CI is the red/green proof:checks-node-changedfails this test withexpected { …(31) } to match object { resumeAfterRestart: { …(1) } }. In the received entry,queuedInputIdsis missing andoperatorSourceis present (for example fix: let package updates start while the Gateway is writing to an agent database #201545, CI run 44445370253).checks-node-changedon this PR must pass this test.Locally on macOS the file loads and its one test is skipped, as designed.
oxfmt,oxlintandgit diff --checkare clean.