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
improvement(agents): leave the stale decay outside the auto-hide setting
Shogunad06feeffedb
diff --git a/CLAUDE.md b/CLAUDE.mdindex 75823f596..ba821852b 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -1846,10 +1846,15 @@ else, and its context links must keep classifying across restarts).late `finish()` is the no-op it already was and the next turn boundary takes it.**A third removal path is opt-in:** `settings.autoHideFinishedSubagentCards` (default OFF, andoff reproduces the two paths above exactly) mirrors into the store as `autoHideFinished`, and- with it on a card is dropped the moment its subagent reports done, by `finish()` and by the- decay alike, with no turn boundary. Only a DONE card is ever dropped, so #547's rule (a new turn- keeps the cards of subagents still running) and Eco's `liveSubagents` are untouched. Renderer- only: Desktop and Server Edition identical, Mobile N/A.+ with it on a card is dropped the moment its subagent REPORTS done, with no turn boundary. Only a+ DONE card is ever dropped, so #547's rule (a new turn keeps the cards of subagents still running)+ and Eco's `liveSubagents` are untouched. **The decay is deliberately NOT one of the paths it+ gates**: `sweepStaleWorking` fires precisely because the end never ARRIVED, which is the opposite+ of what the setting promises, and it is the one case where a visible card carries the most+ information — drop it and a fan-out whose subagents died silently leaves nothing on the canvas+ saying one was ever launched. It costs Eco nothing either way, since an absent card and a `done`+ card are the same answer to `liveSubagents`. Renderer only: Desktop and Server Edition identical,+ Mobile N/A.(Subagents share the parent's process — no PTY.) Each card showsduration/tokens/tool-uses and **expands** (click) to a **live transcript**:`core/subagent-tail.ts` resolves the subagent's own transcript filediff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex fdaaf98a1..c90c2c569 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -7751,7 +7751,6 @@ export function Canvas() {.setAutoHideFinished(settings.autoHideFinishedSubagentCards === true)}, [settings.autoHideFinishedSubagentCards])-/** ids to act on for a node menu: the whole selection if the node is part of it, else just it. */const targetIds = useCallback((node: Node): string[] => {const selected = nodesRef.current.filter((n) => n.selected).map((n) => n.id)diff --git a/src/renderer/state/agentNodes.ts b/src/renderer/state/agentNodes.tsindex 0a1c786af..c441401ba 100644--- a/src/renderer/state/agentNodes.ts+++ b/src/renderer/state/agentNodes.ts@@ -62,10 +62,18 @@ interface AgentNodesState {* `settings.autoHideFinishedSubagentCards`, mirrored here by Canvas so the store stays free of* the settings store.*- * On, a card is DROPPED at the moment its subagent reports done (by `finish()` and by- * `sweepStaleWorking`'s decay alike) rather than left `done` for the next turn boundary to- * take. Only a finished card is ever dropped, so #547's rule (a new turn must keep the cards of- * subagents that are still running) and Eco's `liveSubagents` are untouched.+ * On, a card is DROPPED at the moment its subagent REPORTS done — `finish()`, and only+ * `finish()` — rather than left `done` for the next turn boundary to take. Only a finished card+ * is ever dropped, so #547's rule (a new turn must keep the cards of subagents that are still+ * running) and Eco's `liveSubagents` are untouched.+ *+ * **`sweepStaleWorking`'s decay is deliberately NOT gated on this.** That sweep fires precisely+ * because the end never ARRIVED (crashed CLI, killed pane, slept machine), which is the opposite+ * of the setting's promise, and it is the one case where a visible card carries the most+ * information: drop it and a fan-out whose subagents died silently leaves nothing on the canvas+ * that says a subagent was ever launched. The decay keeps marking `done` and the turn boundary+ * takes the card, exactly as it did before this setting existed. It costs Eco nothing — an+ * absent card and a `done` card are the same answer to `liveSubagents`.** Off is the default and reproduces the previous behavior exactly.*/@@ -282,7 +290,6 @@ export const useAgentNodes = create<AgentNodesState>((set) => ({(id) => s.byId[id].state === 'working' && now - s.byId[id].startedAt > staleMs)if (!stale.length) return s- if (s.autoHideFinished) return dropCards(s, stale)const byId = { ...s.byId }for (const id of stale) {const prev = byId[id]diff --git a/src/renderer/state/agentNodes.turn-boundary.test.ts b/src/renderer/state/agentNodes.turn-boundary.test.tsindex a2a398c70..1d3df2365 100644--- a/src/renderer/state/agentNodes.turn-boundary.test.ts+++ b/src/renderer/state/agentNodes.turn-boundary.test.ts@@ -200,7 +200,11 @@ describe('autoHideFinished: dropping a card the moment its subagent finishes', (expect(useAgentNodes.getState().byId['tu1'].state).toBe('done')})- it('drops the stale sweep’s cards while the setting is on', () => {+ it('does NOT drop the stale sweep’s cards, even while the setting is on', () => {+ // The sweep fires because the end never ARRIVED, which is the opposite of what this setting+ // promises. It is also the case where a visible card carries the most information: drop it and+ // a fan-out whose subagents died silently leaves nothing behind saying one was ever launched.+ // So the decay keeps marking `done` and the turn boundary takes the card, as it always did.const s = useAgentNodes.getState()s.setAutoHideFinished(true)s.start('tu-stale', { parentNodeId: 'n1' })@@ -214,8 +218,18 @@ describe('autoHideFinished: dropping a card the moment its subagent finishes', (}))useAgentNodes.getState().sweepStaleWorking(now)const { byId } = useAgentNodes.getState()- expect(byId['tu-stale']).toBeUndefined()- expect(byId['tu-young']).toBeDefined()+ expect(byId['tu-stale'].state).toBe('done')+ expect(byId['tu-young'].state).toBe('working')+ })++ it('and the turn boundary then takes that decayed card, as it does with the setting off', () => {+ const s = useAgentNodes.getState()+ s.setAutoHideFinished(true)+ s.start('tu-stale', { parentNodeId: 'n1' })+ const startedAt = useAgentNodes.getState().byId['tu-stale'].startedAt+ useAgentNodes.getState().sweepStaleWorking(startedAt + WORKING_STALE_MS + 1)+ useAgentNodes.getState().clearFinishedForParent('n1')+ expect(useAgentNodes.getState().byId['tu-stale']).toBeUndefined()})it('a late finish on a dropped card is a no-op', () => {diff --git a/src/shared/types.ts b/src/shared/types.tsindex c381a8fda..0fa1bff0d 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -1606,10 +1606,10 @@ export interface Settings {* hook holds briefly for a phone/canvas Approve/Deny before falling through to the normal* interactive prompt. Off ⇒ the env var is absent ⇒ exact legacy behavior. Claude-only. */hookReplyApprovals: boolean- /** Remove a subagent's ephemeral canvas card the moment that subagent finishes, instead of- * keeping it until the parent agent's next turn clears it. Default off ⇒ exact legacy- * behavior. A card whose subagent is still running is never removed by this. Settings →- * Agents. */+ /** Remove a subagent's ephemeral canvas card the moment that subagent REPORTS finished, instead+ * of keeping it until the parent agent's next turn clears it. Default off ⇒ exact legacy+ * behavior. A card whose subagent is still running is never removed by this, and neither is one+ * the stale decay marked done because its end never arrived. Settings → Agents. */autoHideFinishedSubagentCards: boolean/** Hold an idle-sleep power assertion while a LOCAL agent node is working, so long runs* survive an unattended laptop. Released when the last one stops (or goes stale). Cannot