Skip to content

fix(test): correct startup rollback and node expiry expectations - #197929

Merged
steipete merged 1 commit into
mainfrom
fix/2430-full-ci-rollback-expiry-fixtures
Nov 12, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/2430-full-ci-rollback-expiry-fixtures

Conversation

@steipete

@steipete steipete commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two full-CI failures: startup rollback expected a cleanup failure after successful settlement, and node invitation expiry depended on whether verification crossed a second boundary.

User Impact

There is no user-visible behavior change. Both tests now enforce their owners' existing contracts without changing deadlines or cleanup behavior.

Why This Change Was Made

The sidecar fix in #197883 correctly made the required late join own final settlement, but missed one startup test expectation. Successful cleanup must preserve the original startup error; genuine cleanup rejection still requires GatewayStartupCleanupError. Separately, the expiry fixture introduced in #194001 sampled its expected deadline after awaited verification, although the owner captures the admission time before it. Freeze only the fixture's Date clock before redemption.

All rollback modes, cleanup-custody checks, expiry/approval assertions, and deadlines remain. Production change: 0 lines; combined test change: −2 lines.

Evidence

Both failures were retained from full run 43299098210. The original rollback matrix reproduced the held-process failure and confirmed it returned the identical original startup error; the corrected four-mode matrix passes. A controlled one-millisecond clock crossing during the actual invitation commit reproduces the expiry mismatch, and the corrected fixture passes that same control and all four owner cases.

Thirty named owner, fixture, dependency and test-configuration inputs match the pinned main base, qualifying those proofs for reuse. Both owners’ pnpm check:changed runs passed, including all three unused-export scans, targeted types, format/lint and guards. A fresh combined Codex P0–P2 review of these exact two files and their complete owner contexts is clean. The component checks are reused through the recorded source comparison. Exact-head PR CI passed, and the completed final-head ClawSweeper review has no findings or open items.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 12, 2026
@steipete
steipete marked this pull request as ready for review November 12, 2026 21:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T21:49:17.876438Z aec8733 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the final two-file fixture correction at aec8733. The startup case preserves genuine cleanup-failure assertions after #197883's successful late settlement; the expiry case freezes only Date before admission. Both controlled failures reproduce on their original inputs, all eight owner cases pass, and the combined independent review is clean. Production code and deadlines are unchanged.

@clawsweeper

clawsweeper Bot commented Nov 12, 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. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR corrects successful startup-rollback expectations and freezes the expiry fixture’s Date clock before node redemption.

Example: A process-owned startup rollback finishes sidecar cleanup after the 5,000 ms diagnostic grace.

  • Before: The test incorrectly expects GatewayStartupCleanupError despite successful final settlement.
  • After: The test expects the identical original startup error while retaining genuine cleanup-failure assertions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is minimal and source-supported; validation consists of reported controlled owner tests, with no shipped-entry-point proof required for this test-only change.
Proof confidence 🦐 gold shrimp (3/6) No user-visible production behavior changes; the supplied validation describes controlled runs through the existing lifecycle and authority owners.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Incorrect and timing-dependent test failures obscure whether Gateway lifecycle and node expiry contracts hold.
Reason: The maintainer-directed correction preserves meaningful failure coverage without changing production behavior or adding machinery.

Merge readiness

✅ Ready for maintainer review

This PR is a focused, correct repair of two test defects still present on current main; no actionable findings were identified.

Priority: P3
Reviewed head: aec87331ea70d35636246e49e140e8c95ac773d2

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway lifecycle tests exercise startup failure and cleanup settlement; OpenClaw ID authority tests exercise signed node invitations, pending deadlines, and owner approval.

flowchart TD
  A[Startup failure fixture] --> B[Gateway startup]
  B --> C[Sidecar cleanup and final join]
  C --> D[Original error or cleanup failure]
  E[Signed node redemption fixture] --> F[Serialized authority admission]
  F --> G[Pending deadline and approval rejection]
Loading

Technical review

Best possible solution:

Merge these minimal fixture corrections after the existing CI gates pass, preserving production cleanup and expiry behavior.

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

Source establishes both failures: successful late cleanup contradicts the old process-owned assertion, and awaited redemption can cross the second sampled by the old deadline expectation; execution was not repeated.

Is this the best way to solve the issue?

Both hunks are the smallest complete repairs using existing owners: distinguish actual cleanup rejection and freeze Date before computing and admitting the pending redemption.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Startup rollback expectation changes intended behavior with a stated reason (e1cd6e1: The original test distinguished process-exiting rollback diagnostics from embedded cleanup; merged fix: allow Gateway restart after late sidecar cleanup #197883 subsequently made successful final sidecar settlement authoritative.)
  • Startup and cleanup error separation keeps the original intent (7bec812: Preserve the startup cause while separately reporting genuine cleanup failures.)
  • Node redemption expiry fixture keeps the original intent (c1b75da: Verify pending invitation expiration and refusal of late owner approval; freezing Date removes elapsed verification time from the expected deadline.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e1cd6e1 adds src/gateway/server-startup-lifetime.test.ts:509 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e1cd6e11ac78; files: src/gateway/server-startup-lifetime.test.ts)
  • Josh Lehman: Raw commit c1b75da adds src/gateway/openclaw-id/authority.nodes.test.ts:237 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c1b75daf7946; files: src/gateway/openclaw-id/authority.nodes.test.ts)
  • sunlit-deng: Raw commit 7bec812 adds src/gateway/server-startup-lifetime.test.ts:945 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7bec812cc68c; files: src/gateway/server-startup-lifetime.test.ts)

PR surface

Tests -2. Total -2 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 4 6 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 4 6 -2

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 P3: This is a narrow test-maintenance repair with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a narrow test-maintenance repair with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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 12, 2026, 4:52 PM ET / 21:52 UTC.

@steipete
steipete merged commit e2d4941 into main Nov 12, 2026
192 of 193 checks passed
@steipete
steipete deleted the fix/2430-full-ci-rollback-expiry-fixtures branch November 12, 2026 22:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant