Skip to content

Fix Windows supervisor replacement launch lock - #1327

Open
jonaowen wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
jonaowen:fix/1286-windows-supervisor-lock
Open

Fix Windows supervisor replacement launch lock#1327
jonaowen wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
jonaowen:fix/1286-windows-supervisor-lock

Conversation

@jonaowen

@jonaowen jonaowen commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • place the replacement-supervisor launch lock in the existing real filesystem supervisor registry instead of the daemon endpoint directory
  • handle Windows directory-rename collision semantics without treating a live contender as a launch failure
  • add a cross-platform regression using a literal Windows named-pipe endpoint and the real replacement method

Validation

  • focused regression: 1 passed
  • npm run check: green (Biome, tsgo, installer render, browser smoke)
  • fresh adversarial review: GO after one correction moved registry creation under the existing reset guard

The patch does not change daemon wire/schema/protocol behavior. It preserves the existing socket hash and stale-lock algorithm; PID-reuse/token/ABA hardening is separate scope.

Fixes #1286.

Note

Fix Windows supervisor replacement launch lock in AgentDaemon

  • Changes the lock directory base in launchReplacementSupervisor from dirname(supervisorSocketPath) to a global registry directory from defaultDaemonSupervisorRegistryDir(), fixing failures when supervisorSocketPath is a Windows named-pipe path with no valid filesystem directory.
  • Creates the registry directory with mode 0o700 before use and treats EPERM on rename (when the destination already exists) as equivalent to a pre-existing lock rather than throwing.
  • Exports defaultDaemonSupervisorRegistryDir from daemon-supervisor-ownership.ts so it can be imported by the daemon mode module.
  • Adds a regression test in 1286-windows-supervisor-lock.test.ts covering the named-pipe path scenario.

Macroscope summarized a62ed57.

@jonaowen
jonaowen force-pushed the fix/1286-windows-supervisor-lock branch from 76133ca to a5ddf83 Compare August 13, 2026 03:58
@jonaowen

Copy link
Copy Markdown
Author

Rebased cleanly onto current main 5e268e28f. Post-rebase focused #1286 regression: 1/1 passed. Post-rebase npm run check: green; 910 files checked, no fixes, tsgo/installer/browser smoke passed.

@jonaowen
jonaowen force-pushed the fix/1286-windows-supervisor-lock branch from a5ddf83 to a62ed57 Compare August 13, 2026 08:44
@jonaowen

Copy link
Copy Markdown
Author

Rebased onto current main 7787f0741. Post-rebase focused #1286 regression: 1/1 passed. npm run check: green; 910 files checked, no fixes, tsgo/installer/browser smoke 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.

Windows supervisor self-replacement always fails: lock directory is created under the named-pipe namespace

1 participant