Skip to content

fix(sdk): await reserved spill writes during close - #4032

Merged
Yeachan-Heo merged 1 commit into
devfrom
fix/issue-3350-devci-31246947834-repair
Aug 9, 2026
Merged

fix(sdk): await reserved spill writes during close#4032
Yeachan-Heo merged 1 commit into
devfrom
fix/issue-3350-devci-31246947834-repair

Conversation

@Yeachan-Heo

@Yeachan-Heo Yeachan-Heo commented Aug 8, 2026

Copy link
Copy Markdown
Owner

#3350 Dev CI repair

Dev CI run 31246947834 failed only SDK query pagination > settles in-progress spill writes before terminal cleanup in coding-agent shard 2.

This replaces the counter/deferred close barrier with per-write settlement reservations created synchronously with createRevision(). Once close() 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.ts

The repair commit is locally SSH-signed (git verified 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.

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-3350-devci-31246947834-repair branch from 980a575 to d5c932b Compare August 8, 2026 08:23
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
Yeachan-Heo force-pushed the fix/issue-3350-devci-31246947834-repair branch from d5c932b to a2cd00b Compare August 8, 2026 09:13

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Yeachan-Heo
Yeachan-Heo merged commit 28c9b91 into dev Aug 9, 2026
22 checks passed
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