Phase B.4 — global outbound command channel. Set once when the
launcher pipe connects; sync callers (CEF lifecycle callbacks
fire on the UI thread) post Commands without needing a
tokio runtime handle. Drained by a task spawned in
connect_to_launcher that writes to the pipe.
If AGENTMUX_LAUNCHER_PIPE is set, connect, Register as Host,
and return a handle the caller (host main.rs) holds for the
host’s lifetime. If unset → return None and the host runs in
pre-Phase-B mode (no launcher connection).
Phase B.5 (window_id_map step b) — sync API: report the
frontend’s register_backend_window IPC to the launcher.
Called from commands/window.rs::register_backend_window
after the host’s local window_id_map insert. No-op if the
launcher pipe isn’t connected.
Phase B.5 (window_id_map step b) — sync API: report a window’s
backend ID being dropped (close path). Called from
client.rs::on_before_close after the host’s local
window_id_map.remove. No-op if launcher pipe absent.
Phase B.4 follow-up — sync API: report the host’s current
authoritative counts so the launcher reducer can compare against
its mirror and emit Event::DriftDetected on mismatch. Callers
invoke this AFTER each window-level transition so the launcher
gets a fresh snapshot to compare against its just-applied
transition.
Phase B.4 follow-up — sync API: report the host’s pool count
only. Used by spawn_pool_window where the windows dimension
is mid-flight relative to the launcher mirror (refill happens
during a close path that hasn’t sent ReportWindowClosed yet);
snapshotting only the pool dimension preserves the
check-every-transition guarantee without producing false
windows-drift. (codex P2 PR #578 round-3.)
Phase B.9.1 (WRR) — sync API: report a Win32 HWND created.
Called from the WRR SetWinEventHook callback. No-op if the
launcher pipe isn’t connected (task dev mode); reducer arm
stashes pending-without-label until reconciliation.
Phase F.6 — sync API: tell the launcher that all browser-pane
HWNDs belonging to a closing top-level window have been reaped
(lifecycle entries drained, pane HWND map cleared, subwindow
cascade closes initiated). Sent from client.rs::on_before_close
AFTER the pane drain step, BEFORE the post-close pool-drain
decision is reported.
Phase F.6 — sync API: tell the launcher the result of the
post-close drain-pool-if-last decision. was_last == true when
the closing window was the last user-visible window (Stage 1 of
the wrr two-stage close cascade just kicked off in
client.rs::on_before_close); false when other windows
remain and the warm pool stays warm.
Phase B.4 follow-up — sync API: report a pool window being added
to the warm pool inventory. Called from spawn_pool_window on
the UI thread. No-op when launcher pipe is absent.
Phase F.5 — sync API: tell the launcher that a pool window is
promoting to a user-visible top-level window. Sent BETWEEN
report_pool_window_removed and report_window_opened so the
launcher’s pool-respawn saga (state-machine bracket around the
implicit refill) can correlate the promote event with the
subsequent PoolWindowAdded for the freshly-spawned replacement
pool slot.
Phase B.4 follow-up — sync API: report a pool window leaving the
pool (promote, destroy). On promote callers should also call
report_window_opened so the label transitions atomically (from
the launcher’s perspective) from pool to windows.
Phase B.4 — sync API: report a window open to the launcher’s
state mirror. Called from CEF lifecycle callbacks on the UI
thread. No-op if the launcher pipe isn’t connected (task dev
mode); failures to enqueue (channel closed, drain task died)
are logged but don’t propagate — the host’s authoritative state
is unaffected, the mirror just falls behind. B.5 tightens.