Skip to content

fix(session): make replacement receipt reconciliation idempotent on Windows - #4370

Closed
asdfqwerzxcc wants to merge 1 commit into
Yeachan-Heo:mainfrom
asdfqwerzxcc:fix/windows-replacement-receipt-reconcile
Closed

fix(session): make replacement receipt reconciliation idempotent on Windows#4370
asdfqwerzxcc wants to merge 1 commit into
Yeachan-Heo:mainfrom
asdfqwerzxcc:fix/windows-replacement-receipt-reconcile

Conversation

@asdfqwerzxcc

Copy link
Copy Markdown

Closes #4368.

Summary

Makes pending replacement-receipt reconciliation idempotent after destination_exists or Windows preflight invalid_request. The reconciler re-captures both paths and accepts success only when final disk state proves it:

  • pending absent and canonical destination present: another reconciler completed the move;
  • both present with equal SHA-256: exact-unlink the captured pending receipt;
  • pending only: preserve the original publish failure;
  • both absent or unequal content: fail closed with a receipt-integrity error.

No invalid_request is ignored without state and hash verification.

Regression coverage

  • another reconciler moves pending to destination before the result is observed;
  • an identical destination already exists;
  • destination hash conflict remains fail-closed;
  • a genuine pending-only invalid_request remains a publish error.

Validation

  • Reproduced and manually validated using an installed-package patch on Windows; session writes recovered after the preflight race.
  • bunx tsc --noEmit -p packages/coding-agent/tsconfig.json passes.
  • git diff --check passes.
  • Focused Bun tests could not run on the authoring macOS host because the repository native addon is absent and Cargo is unavailable to build it. CI should provide the native test environment.

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Superseded by maintainer PR #4373, rebased onto current dev and merged as 278f0a6b4745a8905248afc6c621088afaefe06d. Your original fix remains author-attributed in the landed history; thank you @asdfqwerzxcc for reproducing the Windows race and contributing the core reconciliation patch.

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.

Pending replacement receipt recovery can block all session writes on Windows

2 participants