Skip to content

fix: prevent Windows fsync failures when sending messages - #20

Open
Jerins71 wants to merge 1 commit into
a-mart:mainfrom
Jerins71:fix/windows-controlled-message-fsync
Open

Jerins71 wants to merge 1 commit into
a-mart:mainfrom
Jerins71:fix/windows-controlled-message-fsync

Conversation

@Jerins71

Copy link
Copy Markdown
Collaborator

On Windows, sending a message with either a native Codex or Claude model fails immediately with EPERM: operation not permitted, fsync, before provider work starts. The controlled-input persistence path opens the canonical session file read-only and then calls fsyncSync; Windows rejects that flush.

Open the existing file with r+ in both the fresh-append and same-input retry paths. This provides a write-capable handle without truncating the transcript and retains the durability flush and retry deduplication.

Windows verification

Reproduced on Windows x64 with Node 26.5.0 and Electron 43.2.0 (embedded Node 24.18.0). A disposable-session regression using the real ConversationProjector.appendControlledConversationMessage method reproduced EPERM before the fix and passed after it for both provider types, covering fresh append, same-input retry without duplication, and persisted-history replay. The reporter also confirmed message sending works after applying the fix and restarting Forge Desktop.

Validation passed:

  • pnpm --dir apps/backend exec vitest run src/test/conversation-projector.test.ts — 7 tests.
  • ESLint for the changed file.
  • Backend, environment E2E, and UI typechecks.
  • Backend production build and git diff --check.
  • Restarted Windows Desktop: healthy backend, production UI, and preserved environment identity/history.

pnpm quality:quick hit an existing Windows spawn EINVAL in its command wrapper. Its scheduled lint and typecheck commands were run directly and passed. macOS/Linux were not exercised for this patch.

@Jerins71

Copy link
Copy Markdown
Collaborator Author

Windows reproduction confirmed: native Codex and Claude message sends stopped immediately with EPERM: operation not permitted, fsync. This was reproduced in both pinned host Node 26.5.0 and Electron 43.2.0's embedded Node 24.18.0. The two-line fix passes fresh-message, retry/deduplication, and replay checks, and the reporter confirmed the original sending issue is resolved in Windows Forge Desktop. This PR contains no station configuration, data, credentials, or provider changes.

@Jerins71
Jerins71 requested a review from a-mart October 19, 2026 22:08
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