Skip to content

fix: Windows support for process signals and session persistence#63

Open
thoraxe wants to merge 1 commit intovultuk:mainfrom
thoraxe:fix/windows-process-signals
Open

fix: Windows support for process signals and session persistence#63
thoraxe wants to merge 1 commit intovultuk:mainfrom
thoraxe:fix/windows-process-signals

Conversation

@thoraxe
Copy link

@thoraxe thoraxe commented Jan 20, 2026

Summary

  • Use platform-specific process termination: kill() without arguments on Windows, SIGTERM/SIGKILL on Unix
  • Add fallback for session file save when rename() fails on Windows
  • Ensure storage directory initialization completes before save/load operations

Problem

On Windows:

  1. process.kill('SIGTERM') throws 'Signals not supported on windows'
  2. fs.rename() can fail due to file locks or cross-device moves

Solution

  • Check process.platform === 'win32' and use appropriate termination method
  • Catch rename errors and fall back to direct file write
  • Track initialization state to prevent race conditions

Test plan

  • Test session stop on Windows (no more signal errors)
  • Test session persistence on Windows (fallback to direct write)
  • Verify Unix behavior unchanged (SIGTERM/SIGKILL still works)

🤖 Generated with Claude Code

- Use platform-specific process termination: kill() without arguments on
  Windows, SIGTERM/SIGKILL on Unix
- Add fallback for session file save when rename fails on Windows
- Ensure storage directory initialization completes before operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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