Repository navigation
test: retry every runtime directory removal in the vendor tests and harness - #315
Merged
Merged
Conversation
…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
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) fixedcredential-redaction.vendor.test.ts. #313's CI then hit the same error inclaude-resume.vendor.test.ts("Claude missing resume fails during initialize…", run 38032859591).Rather than fixing these one by one: every remaining
rmof such a directory in sea-trial's vendor tests, harness (aimock.ts,aimock-acp.ts,support/claude-fifo.ts) and cases now usesmaxRetries: 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