Skip to content

fix(ci): await startup readiness before verification assertions - #197366

Closed
steipete wants to merge 1 commit into
mainfrom
fix/2412-startup-verification-ready
Closed

steipete wants to merge 1 commit into
mainfrom
fix/2412-startup-verification-ready

Conversation

@steipete

@steipete steipete commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The hourly full CI run 43087124624 failed both unsealed-startup verification cases under Bun. The fixture used request-facing write admission to wait for startup, but #194484 intentionally bounds that wait to one second while the Gateway continues preparing the database. A cold worker can legitimately exceed that interval.

User Impact

No user-visible behavior change. Hourly CI reliably checks writable startup and later integrity verification on cold workers.

Why This Change Was Made

Await the existing startup lifecycle completion before exercising the unchanged write-admission call. Keep the actual session write before full verification and every subsequent integrity receipt, corruption quarantine, and clean-close assertion. Production behavior and its one-second request deadline are unchanged.

Evidence

On exact main parent 89b4a45aced1aa6057a913f0bc8fd38bc774b600, the ordinary focused test entry reproduces both failures under Node and the healthy case under pinned Bun. No injected delays, retries, or mocks are needed. The candidate passes all 17 cases under each runtime. Node file time is 28.24 seconds; Bun is 25.08 seconds, including real worker and SQLite setup. Both previously failing cases retain their original data/integrity assertions. Fresh independent Codex review has no actionable P0–P2 findings. pnpm check:changed passes every selected gate except one exact-parent unused export: delegatedUserSubjectPrefix, introduced by #196856 and repaired on main by #197358 (c87a2ddd751f9258041d0fff78b9598add29fc7f). Its normalized production/full-tree findings match the canonical scan on exact parent 89b4a45; the script scan is clean. Core/script lint, typechecks, formatting and ratchets pass. Hosted CI timing is not yet available.

Production LOC delta is 0. The two added test lines reuse the existing fixture and have an exact scoped test-line allocation. No additional test process or case, production dependency, schema, or configuration change.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review November 11, 2026 20:12
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 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-11T20:14:26.219870Z 638960b 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.

@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 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Wait for fixture startup preparation before testing write admission and background integrity verification.

Example: The main agent's cold database preparation exceeds the 1,000 ms request deadline.

  • Before: The integrity test can fail during fixture setup before reaching its verification assertions.
  • After: The fixture joins preparation, then checks write admission, background verification, and the appropriate quarantine or clean-close outcome.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is minimal and preserves the intended contract; validation rests on reported focused harness results, with exact-head CI still running.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only correction reports focused Node and pinned-Bun execution through real worker and SQLite setup; it changes no shipped runtime behavior.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Full CI can reject healthy cold-worker startup before the integrity tests reach their intended assertions.
Reason: The maintainer-authored correction restores useful coverage without relaxing assertions, extending production deadlines, or adding test machinery.

Regression provenance

Regression provenance — verified: source commit 0e966cc6e092 by Peter Steinberger; canonical PR #194484 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

This PR is a focused correction to a startup test fixture: it preserves the integrity assertions and the intentional request deadline. No actionable defects were found; exact-head CI remains in progress.

Priority: P2
Reviewed head: 638960b06f2a3ca8687400ea304cb50300d77425

Before merge

None.

Findings

None.

Agent review details

How this fits together

The database startup owner prepares agent databases and publishes admission before background integrity verification finishes; this PR changes only the integration test that exercises that ordering.

flowchart TD
  A[Test fixture] --> B[Startup preparation]
  B --> C[Write admission]
  C --> D[Session write]
  D --> E[Background integrity verification]
  E --> F[Quarantine or clean-close assertions]
Loading

Technical review

Best possible solution:

Keep the existing lifecycle join before write-admission assertions while preserving the production deadline and all integrity outcomes.

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

Source shows the old fixture applying a 1,000 ms request deadline to cold startup preparation; the author reports ordinary base failures and candidate passes on both runtimes, but this read-only review ran no tests.

Is this the best way to solve the issue?

This is the smallest complete correction: reuse the existing preparation completion signal, retain the bounded write call, and leave the original behavior assertions intact.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4464e6f adds src/state/openclaw-database-verify.test.ts:375 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4464e6f09830; files: src/state/openclaw-database-verify.test.ts)

PR surface

Tests +2, Other +2. Total +4 across 2 files. Added test files: 0.

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

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: Repairs a concrete full-CI fixture failure with limited scope and no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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: Repairs a concrete full-CI fixture failure with limited scope and no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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 11, 2026, 3:16 PM ET / 20:16 UTC.

steipete added a commit that referenced this pull request Nov 11, 2026
Reuse the exact fixture and allocation from #197366 (638960b), authored by Peter Steinberger. Join startup completion before retaining the bounded write-admission assertion.
@steipete steipete closed this Nov 11, 2026
@steipete steipete reopened this Nov 11, 2026
steipete added a commit that referenced this pull request Nov 11, 2026
* test(perf): trace agent database close with worker leases

Extend the existing synthetic small-WAL measurement with retained readers and the storage owner shutdown order. Trace WAL stop, resource close, native checkpoint, lease transactions, and worker retirement across isolates. Preserve synthetic path confinement and native-close, lease, and seal assertions. No production behavior change.

* chore: identify slow agent database shutdown phases

Keep native receipt publication in place and correlate slow resource completion after worker cleanup. Add bounded endpoint details to the existing settled-exit watchdog. No durability, timeout, schema, configuration or shutdown ordering changes.

Allocate 108 regression lines for native close phase thresholds, resource-only joins, and bounded real watchdog handles in existing fixtures.

* test: typecheck settled-exit diagnostic parsing

* test(state): join startup preparation in verification fixture

The fixture owns preparation and holds background verification. Join its completion directly while retaining the writable-admission assertion, rather than imposing the production caller deadline on this owner-boundary test. Production timeouts remain unchanged.

* test(state): reuse startup verification readiness fix

Reuse the exact fixture and allocation from #197366 (638960b), authored by Peter Steinberger. Join startup completion before retaining the bounded write-admission assertion.
@steipete

Copy link
Copy Markdown
Contributor Author

Landed through #197382 as 32c839b, which explicitly reuses this PR’s exact fixture repair and allocation from 638960b and preserves Peter Steinberger’s authorship. Both changed files are byte-identical on main.

This PR’s recovered exact-head CI run 43108939419 passed all 21 executed jobs, including openclaw/ci-gate; ClawSweeper has zero findings and open items. The original run failed without a failed job (13 successes and eight stranded queued jobs); GitHub refused the single failed-job rerun with HTTP 403, and one close/reopen started the successful replacement run. No source changes or CI bypass were used.

The native merge owner correctly refused a redundant squash because it would produce no net change. Closing this duplicate as adopted by #197382; the startup-readiness fix is already on main.

@steipete steipete closed this Nov 11, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
* test(perf): trace agent database close with worker leases

Extend the existing synthetic small-WAL measurement with retained readers and the storage owner shutdown order. Trace WAL stop, resource close, native checkpoint, lease transactions, and worker retirement across isolates. Preserve synthetic path confinement and native-close, lease, and seal assertions. No production behavior change.

* chore: identify slow agent database shutdown phases

Keep native receipt publication in place and correlate slow resource completion after worker cleanup. Add bounded endpoint details to the existing settled-exit watchdog. No durability, timeout, schema, configuration or shutdown ordering changes.

Allocate 108 regression lines for native close phase thresholds, resource-only joins, and bounded real watchdog handles in existing fixtures.

* test: typecheck settled-exit diagnostic parsing

* test(state): join startup preparation in verification fixture

The fixture owns preparation and holds background verification. Join its completion directly while retaining the writable-admission assertion, rather than imposing the production caller deadline on this owner-boundary test. Production timeouts remain unchanged.

* test(state): reuse startup verification readiness fix

Reuse the exact fixture and allocation from openclaw#197366 (638960b), authored by Peter Steinberger. Join startup completion before retaining the bounded write-admission assertion.
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. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant