fix: restart Windows companion when launch client changes - #273
fix: restart Windows companion when launch client changes#273ceodaradigu wants to merge 1 commit into
Conversation
|
@nooga This report and fix are ready for bounty review before the current contest deadline. It reproduces cross-client launch attribution drift and adds a focused Windows regression. The current head ( |
|
Thanks for digging into this.
Closing; #272 is flagged for a maintainer call on whether there's a narrower version of the problem worth fixing. |
Fixes #272.
What changed
Why
The Windows launcher exports
MONK_AGENT_LAUNCH_CLIENTonly when it spawns the companion. Its state fingerprint omitted that value, so a healthy process started by Codex was reused when Cursor later invoked the launcher. The process therefore retained stalecodexattribution.Impact
Changing host clients now causes one intentional restart so the companion inherits accurate client attribution. Subsequent launches from the unchanged client continue to use the existing fast path.
Validation
The regression proves the initial Codex launch, unchanged reuse, a single restart after switching to Cursor, persisted
launch_client=cursorstate, and byte-identical generated launcher copies. It is wired into.github/workflows/install-e2e.yml.git diff --checkalso passes.The pre-existing
start-monk-agent-readiness-timeout.ps1harness reached the expected 2-second launcher error but still reports its known Windows test-harnessExitCodeissue; this patch does not touch that path.