Skip to content

chore: keep the Gateway restart handoff test in step with restart markers - #201590

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:test/gateway-restart-handoff-resume-entry-shape
Nov 19, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:test/gateway-restart-handoff-resume-entry-shape

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

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), so openclaw/ci-gate is 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 only operatorSource and scope, and #200533's own tests stopped seeding queuedInputIds. #200394 added operatorSource, 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-owner is the protocol constant GATEWAY_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 journal helper copied a check field 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:

Locally on macOS the file loads and its one test is skipped, as designed. oxfmt, oxlint and git diff --check are clean.

…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.
@clawsweeper

clawsweeper Bot commented Nov 19, 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 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. P2 Normal backlog priority with limited blast radius. 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 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 Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The test expects queuedInputIds: [] and rejects the marker production writes.
  • After: The test checks operatorSource with profileId gateway-owner and localOperator true.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, narrow test correction supported by source contracts and passing exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) No user-visible runtime behavior changes; exact-head changed-test CI supports this assertion-only repair.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Unrelated pull requests can fail their CI gate when the selected restart test asserts a retired data shape.
Reason: The maintainer-authored repair aligns an existing boundary test with an intentional production contract.

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
Reviewed head: b9838a408f1fbbbf7a8a525df0f7a78c49d2768e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Restart-marker assertion changes intended behavior with a stated reason (9344233: The graceful-restart simplification replaced recovery aggregates with a shutdown marker that then included queuedInputIds.)
  • Journal projection keeps the original intent (d4940e8: The receipt-timing test projected structured journal fields; its check property has no reader in the complete current file.)

Security

None.

Evidence

What I checked:

PR surface

Tests +9. Total +9 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 11 2 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 11 2 +9

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: An obsolete assertion breaks selected PR test lanes; the repair has no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: An obsolete assertion breaks selected PR test lanes; the repair has no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed November 18, 2026, 10:18 PM ET / November 19, 2026, 03:18 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit 17e19bf into openclaw:main Nov 19, 2026
95 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the test/gateway-restart-handoff-resume-entry-shape branch November 19, 2026 03:21
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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