fix(sdk): await reserved spill writes during close - #4032
Merged
Conversation
Yeachan-Heo
force-pushed
the
fix/issue-3350-devci-31246947834-repair
branch
from
August 8, 2026 08:23
980a575 to
d5c932b
Compare
The counter-based close barrier can observe an in-flight write without retaining the exact completion it must await. Track a per-write settlement promise synchronously, then await the closed write set before deleting the spill directory. Lore-id: 3f1c7d0b Scope-risk: narrow Reversibility: easy Tested: bun test packages/coding-agent/test/sdk-query-pagination.test.ts
Yeachan-Heo
force-pushed
the
fix/issue-3350-devci-31246947834-repair
branch
from
August 8, 2026 09:13
d5c932b to
a2cd00b
Compare
Yeachan-Heo
commented
Aug 9, 2026
Yeachan-Heo
left a comment
Owner
Author
There was a problem hiding this comment.
MERGE_READY at a2cd00b. Self-authored branch, so recorded as a comment rather than self-approval. Reviewed the close/create race: settlement reservation is inserted synchronously before asynchronous work, close fences new writes before snapshotting the set, and Promise.all waits the snapshot. Exact-head CI is green; no active repair overlap or owner gate found.
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.
#3350 Dev CI repair
Dev CI run 31246947834 failed only
SDK query pagination > settles in-progress spill writes before terminal cleanupin coding-agent shard 2.This replaces the counter/deferred close barrier with per-write settlement reservations created synchronously with
createRevision(). Onceclose()fences new writes, it awaits the exact reservation set before terminal spill cleanup.Validation:
bun test packages/coding-agent/test/sdk-query-pagination.test.ts --test-name-pattern='settles in-progress spill writes before terminal cleanup'bun test packages/coding-agent/test/sdk-query-pagination.test.tsThe repair commit is locally SSH-signed (
gitverified it with RSA SHA256:sMm/mlKbgfQ8MIZwP9ALVJIJujUtUjAEteVdQc03iSI). GitHub commit evidence:980a575d0a078a70f974e17af9a5f72d8b5f604d.Local shard 2 was additionally attempted after building the native addon; unrelated pre-existing docs-index/documentation failures prevented a clean package shard result.