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
fix(context): ensure-track the session on node mount so the meter survives restart
enesbf722ffa4aaa
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsxindex 97bab7622..1dfa06e31 100644--- a/src/renderer/nodes/TerminalNode.tsx+++ b/src/renderer/nodes/TerminalNode.tsx@@ -82,6 +82,13 @@ export function TerminalNode({ id, data, selected }: NodeProps<CanvasNode>) {const showUsage = !!agentId && hasUsage(agentId) // per-node context-window meterconst agentLabel = (agentId ? agentConfig(agentId) : undefined)?.label ?? 'Agent'const status = useAgentStatus((s) => s.byId[id])+ // Feed the context meter without waiting for a live hook event: after an app restart the+ // continuing tmux session is idle and emits no event, so the main-process tailer is never+ // re-fed. Re-runs if the sessionId changes (track is idempotent). cwd is a path fallback.+ useEffect(() => {+ const sid = status?.sessionId+ if (showUsage && sid) window.nodeTerminal.context.ensure(sid, (data.cwd as string) || undefined)+ }, [showUsage, status?.sessionId, data.cwd])const updateNodeInternals = useUpdateNodeInternals()const [searchOpen, setSearchOpen] = useState(false)