Skip to content

Fix multi-instance launches for packaged community users#250

Closed
avifenesh wants to merge 2 commits into
ilysenko:mainfrom
avifenesh:codex/multi-instance-community-fix
Closed

Fix multi-instance launches for packaged community users#250
avifenesh wants to merge 2 commits into
ilysenko:mainfrom
avifenesh:codex/multi-instance-community-fix

Conversation

@avifenesh
Copy link
Copy Markdown
Collaborator

Summary

  • Add an Open New Instance desktop action (with CODEX_MULTI_LAUNCH=1 and --new-instance) so users can launch a second Codex process from the launcher right-click menu without knowing CLI flags.
  • Skip warm-start and Electron second-instance handoff when multi-launch is active, preventing an already-running default instance from hijacking an explicit --new-instance request.
  • Install PR_SET_PDEATHSIG(SIGTERM) in the embedded webview HTTP server so orphaned servers cannot permanently block webview ports after a crashed or killed launcher.

Builds on the bootstrap lock bypass from #229. Normal icon clicks still focus the existing instance by design; this PR makes the opt-in multi-instance path discoverable and more reliable for packaged installs.

Test plan

  • node --test scripts/patch-linux-window-ui.test.js (125/125 pass)
  • python3 -c "import py_compile; py_compile.compile('launcher/webview-server.py')"
  • Launcher multi-instance guard validation (detect_warm_start + using_second_instance_handoff)
  • Rebuild/install package and verify right-click Open New Instance starts a second window while the first remains open
  • codex-desktop --new-instance with an existing instance running
  • Kill launcher with kill -9 and confirm webview port is released within ~2s

Made with Cursor

avifenesh and others added 2 commits May 20, 2026 01:22
Expose a desktop Open New Instance action, skip warm-start handoff when multi-launch is active, and terminate orphaned webview servers when the launcher dies so ports stay available.

Co-authored-by: Cursor <cursoragent@cursor.com>
Uses a temp copy of the side-by-side dev app with a mock Electron binary so launcher multi-launch behavior can be verified without touching production codex-app.

Co-authored-by: Cursor <cursoragent@cursor.com>
@avifenesh avifenesh marked this pull request as draft May 19, 2026 22:32
@avifenesh avifenesh closed this May 19, 2026
@avifenesh
Copy link
Copy Markdown
Collaborator Author

@Leay15 Im sorry, claude making me misrable. soon.

@avifenesh avifenesh deleted the codex/multi-instance-community-fix branch May 19, 2026 22:48
@Leay15
Copy link
Copy Markdown
Collaborator

Leay15 commented May 19, 2026

@avifenesh No worries 😄

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.

2 participants