Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

Merge main preserving remote Codex and phone consent guidance

reviewda6f855fc65e
diff --cc CLAUDE.md
index 21ad1e053,ba14638a0..14553a9b6
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@@ -4904,10 -4951,19 +4951,27 @@@ sessions is a hazard whatever kills it
When a change is genuinely desktop-only (native menus, auto-update, Keychain), say so; the
point is to make the call consciously, not to leave the other surfaces to rot.
+Remote Codex safety (#736): `spawnNew` requires managed SSH Codex accounts (including custom
+Codex harnesses and known agent-less login terminals) to have a safe id in the saved Codex account
+list and a safe resolved `remoteHome`. `remoteAccountScopeEnvArgs` then supplies the private
+`CODEX_HOME` and account marker. An unresolved or unsafe home must refuse before env staging/spawn,
+not fall back to the host's system login. System Codex retains the host environment even before
+home discovery during early attach. Never guess HOME/CODEX_HOME. Desktop and Server share this
+core gate; Desktop supports the remote lifecycle, while Server account management remains unavailable.
++
+ ### Standing phone consent lifetime (#819)
+
+ A browse socket can close before the human clicks the SAS dialog. `core/phone-approval.ts` retains
+ only the handshake-bound id/key for 120 seconds, at most 64 requests, one per key. Socket closure
+ releases presence and transport but does not discard that bounded consent; replacement, rejection,
+ expiry and host stop clear the exact dialog id. Approval requires BOTH id and displayed key (no
+ key-only match or mismatched-key fallback), consumes once, then persists before granting access.
+ `remote:phone:approve` is raw, owner-window Electron IPC, never a relay RPC. Its response separates
+ stale/persistence failure from approved/saved-disconnected; renderer rejection/timeout is explicitly
+ unconfirmed. SAS derivation and mutual trust verification are unchanged. Legacy interactive offers
+ remain session-only, and Server Edition rejects standing phone approval as unsupported.
+
+ Pin/revoke mutations use `updateApprovedDevices` to queue the entire read/modify/write in process;
+ unique-temp atomic rename alone cannot prevent lost updates. Non-ENOENT reads and malformed JSON
+ reject rather than overwrite unknown trust state. The queue is not a cross-process lock. A click
+ accepted before host stop may finish its disk save, but must never open the now-closed session.
diff --cc CONTRIBUTING.md
index 74976ac02,2d2bf4cbb..f6564d870
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@@ -796,14 -819,13 +819,21 @@@ Two files, two audiences
invariant that only lives in a commit message is one refactor away from being violated by someone
who never saw it.
+Remote Codex account safety (#736): managed SSH Codex sessions and agent-less login terminals
+require a known safe account id and a safe resolved remote home before spawning. The remote env
+builder supplies their private `CODEX_HOME`; never fall back to the system login when that scope
+is unavailable. System SSH Codex retains the host environment, including during early attach
+before home discovery; never inject a guessed `HOME` or `CODEX_HOME`. Custom Codex harnesses use
+the same guard. Desktop supports remote account lifecycle; the Server browser still explicitly
+rejects managed Codex account management.
+
+ **Phone consent belongs to the verified handshake, not the browse socket.** A standing phone's
+ SAS request survives transport closure only until its 120-second deadline; approval requires the
+ issued id and displayed box key together. Keep request/reply outcomes distinct (stale request,
+ failed pin save, missing IPC response, saved-but-disconnected). All production pin/revoke writers
+ must use `updateApprovedDevices` for the whole read/modify/write, so concurrent updates cannot
+ lose approvals or resurrect revoked keys. Server Edition does not host this legacy relay path.
+
Managed Codex login terminals are agent-less: core identifies their provider from the saved
account list. Before opening one, await `useSettings.getState().flush()` after adding the account.
The normal 300 ms coalesced save is too late: an unknown id can launch against the system home.