Skip to content

test: retry every runtime directory removal in the vendor tests and harness - #315

Merged
xxchan merged 1 commit into
mainfrom
test/retry-runtime-dir-cleanup
Oct 10, 2026
Merged

xxchan merged 1 commit into
mainfrom
test/retry-runtime-dir-cleanup

Conversation

@xxchan

@xxchan xxchan commented Oct 10, 2026

Copy link
Copy Markdown
Member

Windows CI keeps failing with EBUSY: resource busy or locked, rmdir … when a vendor test removes a directory that a runtime process was using a moment before. #296 (#288) fixed credential-redaction.vendor.test.ts. #313's CI then hit the same error in claude-resume.vendor.test.ts ("Claude missing resume fails during initialize…", run 38032859591).

Rather than fixing these one by one: every remaining rm of such a directory in sea-trial's vendor tests, harness (aimock.ts, aimock-acp.ts, support/claude-fifo.ts) and cases now uses maxRetries: 10, retryDelay: 300, as the already-fixed ones do. The recording helpers (sea-trial/record/*) don't run in CI and are left alone. Test-only; no release.

🤖 Generated with Claude Code

…arness

Windows CI keeps failing with EBUSY when a vendor test removes a directory
a runtime process used a moment before (#288 fixed one file; #313's CI hit
the same in claude-resume.vendor.test.ts). Every remaining rm of such a
directory in sea-trial's vendor tests, harness and cases now retries, as
the fixed ones do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@xxchan
xxchan merged commit e4ee774 into main Oct 10, 2026
17 checks passed
@xxchan
xxchan deleted the test/retry-runtime-dir-cleanup branch October 10, 2026 07:17
xxchan added a commit that referenced this pull request Oct 10, 2026
Replaying a session's records lost the native parent/child graph, so
hosts such as Ferry could not reproduce `Session.usage().withChildren`.
Lineage now travels on the native frame that establishes it, and live
queries and replay use the same graph and token folds.

- Add `session_linked { parent, child, via: "tool_call" }` for Codex
collaboration items, ACP lineage notifications and OpenCode v2 child
attribution. `graphOf(records)` is exported through the observe, root
and browser entries. The kernel updates the same graph fold as each
record is appended, using a Set for node ids; `graph()` returns the
retained value without rescanning the log. Repeated facts retain their
original frames but produce one edge.
- Derive lineage by default in `usageOf(records, sessionId)`, retaining
its explicit graph override. SessionView keeps every session's latest
totals, so reports before lineage, nested descendants and repeated
cumulative figures contribute exactly once. Unrelated session ids never
imply a child, and the usage cursor includes the frame that establishes
relevant lineage even when another session reports it.
- Keep unknown accounting unknown. Old records without lineage do not
gain `withChildren`. Grok's root ledger already includes child spend:
its child ledgers remain native-only and are not added again. Correct
the contrary SessionUsage comment and attribution spec, linked to the
existing Grok evidence and regression.

Host impact: exhaustive event switches need a `session_linked` case.
Incremental SessionView checkpoints must retain `sessionGraph` and
`usageBySession` with its nested Maps; replay raw records when upgrading
checkpoints. The existing root `usageByAgent` and `usageTotal` fields
remain available. Adapter authors put the event returned by
`kernel.link(edge)` in the source frame; out-of-band `kernel.node()` is
removed. The live graph still starts with the known root id.
`graphOf([])` stays empty and learns the root from its first recorded
appearance; this initial seed is the only information supplied outside
the records.

Validation: full check (1,590 tests) and build on main aa8f5e3,
including #313, #315 and #317; all five behavior backends; 35 Codex
native tests. Added regressions cover JSON persistence, live/replay
equality after each append, synchronous source-frame observation,
incremental and flat-event views, graph and checkpoint immutability,
late edges, repeated reports, nested/shared descendants, cycles, unknown
totals and explicit graph overrides. Codex's actual Session path,
recorded Grok wire shapes and the OpenCode v2 child fixture all verify
replay against live results. All runtime tests use scripted providers,
with no real-account quota.

Closes #312.

---------

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant