Repository navigation
fix(gateway): read complete startup timeline records in boot test - #191804
Conversation
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]>
|
🦞👀 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 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.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +2, Other +2. Total +4 across 2 files. Added test files: 0. View PR surface stats
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 3, 2026, 4:47 AM ET / 09:47 UTC. |
|
Merged via squash auto-merge.
|
…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]>
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
b7c01ed7fa476cd8580b2676b0886dc5a5dd200d:server-startup-minimal-boot.test.ts > boots and refreshes skill snapshots on each start, JSON parse errorUnterminated stringat the asynchronous timeline read. The job log was fetched once.server-startup-minimal-boot.test.tsfile: 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.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.