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.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
Merge reviewed PR872 and PR871 retaining independent question lifecycle
review78ff1c119bd3
diff --cc CLAUDE.mdindex cead839c3,7e1c35aab..3e967a579--- a/CLAUDE.md+++ b/CLAUDE.md@@@ -4943,26 -4951,58 +4951,82 @@@ sessions is a hazard whatever kills itWhen a change is genuinely desktop-only (native menus, auto-update, Keychain), say so; thepoint is to make the call consciously, not to leave the other surfaces to rot.+An unanswered Claude `AskUserQuestion` is correlated by session and tool-use ID in the core+mirror, independently of its short-lived display stash. Ordinary hooks, subagent activity and+unrelated transcript results must not clear attention or archive its inbox card. Both shells+use `recordQuestionResult` for transcript rescue (including Escape/decline), and broadcast the+mirror's effective event. Keep result IDs through local and SSH tails; a boolean “some tool+finished” is insufficient. Explicit new user turns, interrupts and session boundaries reset it.++Claude child `PreToolUse`/`PostToolUse`/`PostToolUseFailure` hooks must not drive parent state.+Child `PermissionRequest` and attention `Notification` hooks still reach needs-you and phone+approvals, including the raw approval summary and deterministic reply ticket. Keep raw summary+recording before the child transcript-association guard in both shells.++A held parent question can overlap child permissions: retain its question card and waiting+state while publishing each approval ticket separately. Approval replies resolve only their+own ticket; the picker stays pending until its correlated answer or explicit reset.+When the parent answers first, retain concurrent approval tickets and blocked attention until+their own replies; ordinary tool activity cannot settle them. Explicit turn/session resets+still cancel both kinds of pending attention.++Held approval attention must not replace subagent, recurring or background-task events, or refresh+state evidence from those lifecycle hooks. A parent may ask several questions while a child ticket+is outstanding: track each new picker and preserve child approval cards independently, including+when their display titles match. Answering either resolves only that question or ticket.+++ 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.++ ## Media playback lifetime (#680)++ Audio routes through `isMediaFile` to the existing persisted `video` kind and native audio controls.+ Legacy audio editor nodes migrate on load. Desktop uses the existing local/SSH allowlist; Server+ and relay retain their explicit media transport degradation. Native mobile does not consume these+ React nodes; its own player/IME behavior requires a separate device check.++ Remote cache entries requested in this run are retained until exit, including cache hits; pruning+ waits are coordinated with a concurrent cache reader. The 20-entry cap is soft for retained files,+ so disk use may grow in a long run; prior-run entries are eligible again after restart. `mediaRange`+ handles suffix ranges and rejects unsatisfiable ones without weakening the serve-time path jail.++ ## Subagent reload replay (#680)++ `core/subagent-replay.ts` retains at most 512 running starts for the existing WORKING_STALE_MS,+ with original host timestamps. The shared mirror event path feeds it (including synthetic async+ ends); session boundaries and clearNode discard it. Both shells expose the same read, and desktop+ preload / browser / relay subscribe before requesting it. Only lifecycle events wait behind the+ snapshot (bounded to 512 events / 3 seconds); live permission alerts are not delayed or replayed.+ No disk restore, transcript backlog, completed-card replay, or authorization evidence is provided.+ A host restart or a missed original start is still outside this recovery.+++ ## IME mode switching (#680)++ `terminal/ime-mode-switch.ts` adapts xterm 5.5's composition helper after `open()` in both terminal+ surfaces. Caps Lock must not finalize an active composition: the subsequent native compositionend+ owns that commit. The test executes the dependency's real helper, with an unpatched double-send+ control. This pins one event ordering, not every native IME; macOS Chinese Caps Lock still needs a+ device run, including insertText and compositionend orderings. Revalidate the adapter on xterm upgrades.++ ### 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.mdindex c515ca6d0,ceb88e159..5db368f21--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@@ -814,12 -819,26 +819,33 @@@ Two files, two audiencesinvariant that only lives in a commit message is one refactor away from being violated by someonewho never saw it.+An unanswered Claude `AskUserQuestion` is correlated by session and tool-use ID in the core+mirror, independently of its short-lived display stash. Ordinary hooks, subagent activity and+unrelated transcript results must not clear attention or archive its inbox card. Both shells+use `recordQuestionResult` for transcript rescue (including Escape/decline), and broadcast the+mirror's effective event. Keep result IDs through local and SSH tails; a boolean “some tool+finished” is insufficient. Explicit new user turns, interrupts and session boundaries reset 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.++ - Media URLs live for the app run. Remote cache pruning must keep files already handed to+ players; the cache cap is soft until restart. Use the existing `video` node for audio too.+ - Subagent reload replay is display-only and current-host-only. Never replay status/permission+ events or treat a replayed card as verified process ownership; subscribe before taking its snapshot.++ **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 savedaccount 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.