Repository navigation
fix: keep session retention proofs reliable in CI - #186123
Conversation
|
🦞👀 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 assigns session forced-collection tests to Node and extracts collection cases from mixed suites while preserving their CI selection. Example: CI runs with OPENCLAW_CI_TEST_RUNTIME_POLICY=bun-all.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it corrects a current CI runtime mismatch while preserving neighboring Bun coverage, with no blocking defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe CI runtime selector receives test targets and project inventories and produces Node and Bun execution partitions for the shard runner. flowchart TD
A[Changed source and test targets] --> B[Protected test selection]
B --> C[Project inventories]
C --> D[Runtime selector]
D --> E[Node collection tests]
D --> F[Bun functional tests]
Technical reviewBest possible solution: Keep exact runtime exceptions in the existing selector and isolate only collection-dependent cases while retaining functional Bun coverage and original selection ownership. Do we have a high-confidence way to reproduce the issue? Current-main routing omits these session exceptions despite their V8 collection assertions; the linked failed job supports the report, but no reproduction was run during this read-only review. Is this the best way to solve the issue? The existing exact-file selector is the appropriate owner, and extracting the two mixed-suite cases avoids unnecessarily removing functional Bun coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 594988722025. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +1, Other +4. Total +5 across 12 files. Added test files: 2. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (1 earlier review cycle)
Reviewed October 27, 2026, 2:26 PM ET / 18:26 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: Session collection checks run on Node/V8 while neighboring functional tests retain Bun coverage. |
Route session forced-collection checks to Node/V8 while preserving Bun functional coverage, database-worker ownership, and protected PR selection.
What Problem This Solves
Fixes CI running four session forced-collection checks on Bun/JavaScriptCore even though their zero-live-target assertions use V8 heap instrumentation. In the observed
bun-alljob, the session row projection retention test reached its unchanged collection oracle but still saw eight live WeakRef targets.User Impact
There is no product behavior change. Session lifecycle, retention, garbage-collection assertions, ordering, and timeouts remain unchanged; CI now evaluates these existing proofs on the Node/V8 runtime they require while nearby functional session tests continue to run on Bun.
Why This Change Was Made
The runtime selector already keeps tests that require forced WeakRef collection on Node because JavaScriptCore conservatively scans stack references and cannot provide the same zero-live-target observation. The affected session tests were missing from that literal selector list.
This change keeps the existing history and row-projection retention suites on Node, moves only the accepted-suffix and sharing discovery-context collection cases into a dedicated database-retention suite, and retains that suite's database-worker shard and protected PR selection. Their mixed parent suites remain Bun-selected, so unrelated functional assertions keep their existing Bun coverage.
The selector's direct contract and real shard-runner coverage verify both sides of the partition: only the three forced-collection retention files are assigned to Node and excluded from Bun, while both mixed parent suites remain on Bun. A shared test helper preserves the one-yield, one-V8-query collection boundary and creates synthetic controls in completed frames. No runtime mechanism, workflow, unrelated sharding rule, dependency, production source, assertion, GC sequence, or timeout changes.
Evidence
src/gateway/session-row-projection.retention.test.tsin a Bun-labeled shard and failed its zero-live-target assertion with eight retained references.bun-allwrapper ran all affected files on their owning runtimes: Node history retention 3/3, core row-projection retention 2/2, and database retention 2/2; Bun accepted-facts 22/22 and sharing-preparation 20/20.gatewayDatabaseWorkerTestFilesandPR_PROTECTED_RUNTIME_TEST_FILES, with source-owner coverage binding the new file to the existing protected-selection contract.