Skip to content

Fix custom agent path handoff - #271

Open
jamilahmadzai wants to merge 1 commit into
monk-io:mainfrom
jamilahmadzai:fix/custom-agent-path-handoff
Open

Fix custom agent path handoff#271
jamilahmadzai wants to merge 1 commit into
monk-io:mainfrom
jamilahmadzai:fix/custom-agent-path-handoff

Conversation

@jamilahmadzai

@jamilahmadzai jamilahmadzai commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • stop the companion recorded in launcher state when MONK_AGENT_PATH changes
  • preserve the existing bounded stop guarantee before launching the replacement
  • add deterministic POSIX and Windows regressions to the install workflow

Root cause

The launcher compared a saved PID against the newly selected executable. During an A-to-B custom path switch, that ownership check rejected the still-running A process, so B could exit on the occupied endpoint while the launcher reported A as ready.

The launcher now reads the prior executable from its saved state and validates the saved PID against that path before stopping it.

Validation

  • all shell regression tests pass on macOS
  • shell syntax checks pass
  • all three POSIX launcher copies are byte-identical
  • all three PowerShell launcher copies are byte-identical
  • workflow YAML parses successfully
  • Install E2E passes on Ubuntu, macOS, and Windows for the published commit

The upstream run is awaiting the repository approval required for first-time contributors.

Fixes #270

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.

[Bug bounty] Custom agent path switch returns success with the old companion still running

1 participant