Skip to content

fix: restart Windows companion when launch client changes - #273

Closed
ceodaradigu wants to merge 1 commit into
monk-io:mainfrom
ceodaradigu:codex/fix-windows-launch-client-drift
Closed

fix: restart Windows companion when launch client changes#273
ceodaradigu wants to merge 1 commit into
monk-io:mainfrom
ceodaradigu:codex/fix-windows-launch-client-drift

Conversation

@ceodaradigu

Copy link
Copy Markdown

Fixes #272.

What changed

  • persist the detected Windows launch client in the companion state file
  • include that value in the healthy-process reuse gate
  • keep all three shipped PowerShell launcher copies byte-identical
  • add an isolated Codex-to-Cursor drift regression and run it in Windows Install E2E

Why

The Windows launcher exports MONK_AGENT_LAUNCH_CLIENT only 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 stale codex attribution.

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

launch_client_restart_status=pass launches=2

The regression proves the initial Codex launch, unchanged reuse, a single restart after switching to Cursor, persisted launch_client=cursor state, and byte-identical generated launcher copies. It is wired into .github/workflows/install-e2e.yml. git diff --check also passes.

The pre-existing start-monk-agent-readiness-timeout.ps1 harness reached the expected 2-second launcher error but still reports its known Windows test-harness ExitCode issue; this patch does not touch that path.

@ceodaradigu ceodaradigu changed the title Fix-Windows-launch-client-drift fix: restart Windows companion when launch client changes Aug 7, 2026
@ceodaradigu
ceodaradigu marked this pull request as ready for review August 7, 2026 11:41
@ceodaradigu

Copy link
Copy Markdown
Author

@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 (d463eb6) is mergeable, with local result launch_client_restart_status=pass launches=2, and all three shipped launcher copies remain byte-identical. Please let me know if any additional eligibility evidence is needed; no merge or credit is assumed.

@nooga

nooga commented Aug 9, 2026

Copy link
Copy Markdown
Member

Thanks for digging into this.

MONK_AGENT_LAUNCH_CLIENT is deliberately excluded from the healthy-process restart gate — commit 702884c documents that. It's there so the companion doesn't restart every time you switch between agents in the same session. Re-adding it on Windows only would reintroduce exactly that churn, and asymmetrically.

Closing; #272 is flagged for a maintainer call on whether there's a narrower version of the problem worth fixing.

@nooga nooga closed this Aug 9, 2026
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] Windows fast path preserves stale launch-client attribution

2 participants