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
docs: a hidden window counts as offscreen for the memory levers
reviewb6a128861f9a
diff --git a/CLAUDE.md b/CLAUDE.mdindex c06ca6534..6613514f0 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -638,6 +638,17 @@ Lifecycle, by intent:See the Terminal node lifecycle section for the two invariants (mount-stable observer;`session.source` remote gate). Note the released node is a DETACHED tmux session — it joinsthe session reaper's candidate pool (6 h grace still protects it).+- **A hidden window counts as offscreen (2026-10)** → close-to-tray (the Windows default), macOS+ hide-on-close and minimize send `app:window-visibility` (`main/window-visibility.ts`); the+ renderer flag (`terminal/window-backgrounded.ts`) makes every node report itself offscreen+ through the SAME mount-stable observer path, so the release runs at `min(offscreen setting,+ BACKGROUND_RELEASE_DWELL_MS = 2 min)` behind every existing gate (live-work, held launch, Eco,+ remote, selected, `0 = never`); after that dwell Canvas runs the memory-pressure reclaim pair+ (`runReclaimLevers`), which now frees the on-screen terminals' WebGL contexts too because they+ all read hidden. Show cancels the dwell and revives warm. It feeds existing levers — it is not a+ new one — and an occluded window or a Server Edition tab switch never triggers it (explicit IPC,+ not `visibilitychange`; the bridge declares it a no-op). Eco and the liveness poll see a hidden+ window as "nobody watching" too.- **Every memory lever must ask whether the kill ends live work** (`terminal/live-work.ts`). Therenderer reclaims terminal memory in FOUR places — park window expiry, the park's LRU cap, thememory-pressure drop (all three in `park-budget.ts`) and the offscreen viewer releasediff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 4794b1458..39fe95803 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -726,6 +726,12 @@ bug.name the project boundary and explain that cross-project linking is unsupported; do not scan otherprojects just to improve a missing-endpoint diagnostic.+**A memory lever that drops a terminal's PTY client asks the live-work gate first**+(`terminal/live-work.ts`): without tmux the pty IS the shell, and the "free" release kills the+agent in it. A hidden/minimized window feeds the existing levers by making every node read+offscreen (`terminal/window-backgrounded.ts`) — reuse that input rather than adding a parallel+release path that would have to re-implement every gate.+**A failed read is never evidence of absence.** "Could not measure" and "there is nothing" aredifferent facts and must stay distinguishable at every layer. Collapsing them is how a panel ends upreporting "no sessions" on a host running thirty. When something ACTS on the negative, give it three