Skip to content

fix(gateway): read complete startup timeline records in boot test - #191804

Merged
roboclaw-bot merged 1 commit into
mainfrom
main-ci/l269-startup-timeline
Nov 3, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
main-ci/l269-startup-timeline

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes intermittent main CI failure in the Gateway boot test when background diagnostics append while the test reads its timeline.

User Impact

No user-visible behavior change. The boot test retains its skill-refresh and startup-readiness ordering assertions.

Why This Change Was Made

Flush the existing timeline writer and read the file synchronously in the same event-loop turn, matching the other timeline test consumers. The asynchronous read could return an incomplete final JSON record while post-ready work appended. No retry, skip, timeout change, ignored record, or weakened assertion is added. Production and authorization code are unchanged.

The two added test lines require a separate two-line allocation; the shared baseline is unchanged. Simplification left one consumer repair and its exact allocation, with no new helper or state owner.

Evidence

  • Failed scheduled main job 125807862752, head b7c01ed7fa476cd8580b2676b0886dc5a5dd200d: server-startup-minimal-boot.test.ts > boots and refreshes skill snapshots on each start, JSON parse error Unterminated string at the asynchronous timeline read. The job log was fetched once.
  • The same code passed job 125784725656. Relevant test and writer files are unchanged between those runs.
  • Focused one-file lint, oxfmt formatting, and diff checks pass. Exact-head CI job 125833551061 passes the named server-startup-minimal-boot.test.ts file: 4/4 tests, 128.21s file duration, including the original failure case in 12.484s. This real boot proof includes two starts and the ambient/config variants; compiler transformation dominates file duration. Local native-worker proof was deferred on the production host; Testbox queued and was stopped without dispatch. Full exact-head CI 41611104039 completed successfully.
  • Independent Codex autoreview of the complete local change against 29e5360e957886bf47810b72dfe25dca44250e96: validated scoped-clean P0–P2, with explicit authorization focus (no widened access, distinct invocation keys, no stale-fact override). Runtime proof was explicitly unverified in that assessment.

Related: maintainer-directed main CI repair campaign, lane l269, run 41603462722.

Flush the existing diagnostics writer and read synchronously so post-ready appends cannot race an asynchronous file snapshot. Preserve all startup ordering and skill-refresh assertions. Allocate exactly the two added regression-test lines.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 3, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 3, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 3, 2026 09:26
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) November 3, 2026 09:39
@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR flushes buffered diagnostics and reads the startup timeline synchronously before checking boot ordering.

Example: The minimal-boot test reads gateway-startup.jsonl after either of its two Gateway starts.

  • Before: An asynchronous read can overlap background appends and return an incomplete JSON record.
  • After: The test flushes pending events and reads them in the same event-loop turn before parsing.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A correct, minimal test repair supported by source contracts and successful exact-head harness CI; no shipped-entry-point proof is claimed.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only repair is outside the ordinary contributor proof gate; the exact-head CI job succeeds, and the existing harness exercises real Gateway startup twice.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Intermittent boot-test parse failures obscure genuine startup regressions and disrupt CI.
Reason: The maintainer-authored repair restores reliable observation of an existing contract with no production machinery or weaker assertions.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it makes a focused, sound repair to the boot test’s timeline read without weakening assertions or changing production behavior; required CI remains pending.

Priority: P2
Reviewed head: 372af061101cc5166a122728c68f9c4d91917ead

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-entry-point proof is needed for this test-only repair; the linked failing trace and per-test passing output could not be independently inspected through the blocked log-download host.
Agent review details

How this fits together

Gateway startup emits diagnostics into a buffered JSONL writer; the boot test consumes those records to verify startup ordering and skill refresh.

flowchart LR
  A[Gateway startup] --> B[Diagnostics writer]
  B --> C[Buffered events]
  C --> D[Synchronous flush]
  D --> E[Timeline file]
  E --> F[Boot ordering assertions]
Loading

Technical review

Best possible solution:

Merge this focused consumer repair once the existing required checks pass.

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

Source inspection establishes an asynchronous file read concurrent with scheduled synchronous appends; the PR links an Unterminated string failure, but this review ran no target code.

Is this the best way to solve the issue?

The smallest complete fix uses the existing flush owner and synchronous read, preserving strict JSON parsing, ordering checks, timeouts, and skill-refresh coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 82aae6a1bed8.

Provenance checked

  • Startup timeline parsing and readiness assertions keeps the original intent (fix(gateway): publish readiness after startup span #188873: Verify that non-deferred Gateway readiness is published after runtime.post-attach completes.)
  • Real minimal-Gateway boot coverage keeps the original intent (34b8a65: Catch startup stalls with bundled plugins enabled that previously escaped Gateway CI.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 877dcb4 adds src/gateway/server-startup-minimal-boot.test.ts:133 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 877dcb4433ca; files: src/gateway/server-startup-minimal-boot.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 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 2 6 2 +4

Labels

Label changes:

  • add P2: An intermittent boot-test failure disrupts CI with limited direct user impact.
  • 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:

  • P2: An intermittent boot-test failure disrupts CI with limited direct user impact.
  • 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 3, 2026, 4:47 AM ET / 09:47 UTC.

@roboclaw-bot
roboclaw-bot merged commit 211989e into main Nov 3, 2026
210 checks passed
@roboclaw-bot
roboclaw-bot deleted the main-ci/l269-startup-timeline branch November 3, 2026 09:52
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…enclaw#191804)

Flush the existing diagnostics writer and read synchronously so post-ready appends cannot race an asynchronous file snapshot. Preserve all startup ordering and skill-refresh assertions. Allocate exactly the two added regression-test lines.

Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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