How long a relaunch keeps at it when the running instanceโs host didnโt
take its open_new_window: long enough for an instance that is quitting
to let go of the single-instance socket/pipe (its launcher holds on until
srv has closed every agent, up to SRV_EXIT_WAIT, via
upgrade::quiesce_srv).
A relaunch whose forward failed with first: the running instance is
starting (no port file yet) or quitting (its host is gone; a clean exit
deletes the port file). Until QUITTING_INSTANCE_WAIT passes, take the
socket/pipe as soon as the old launcher lets go of it, or forward as soon
as the host answers. Shared by both supervisors.
Bind the launcherโs IPC socket with single-instance enforcement +
crash-safe stale-socket recovery, serialized across concurrent
launchers via flock(2).
What a launcher that lost the single-instance race does: open a window in
the running instance, unless it was started by a login entry, which only
asks that AgentMux be running (SPEC_START_WITH_OS_2026_09_25.md ยง3.6).
Not used by the macOS reopen handler, which is a user asking for a window.
Returns the forwardโs error, if any, for await_running_instance.
forward_host_cmd with an args object โ the hostโs /ipc body is
{"cmd", "args"} (crates/cef/src/ipc.rsIpcRequest). Used by the
notification click path (open_new_window {workspace_id},
focus_window {label}).
User-facing message for an actual second-instance collision (not a
bind-failure, not a stale socket โ a real running launcher answered our
connect probe). Shared by both call sites in
bind_socket_with_recovery (fast-path and post-recovery-lock retry),
which previously duplicated this message and both got it wrong the same
way โ see docs/specs/SPEC_DEV_INSTANCE_ISOLATION_DIAGNOSTICS_2026_09_19.md.