agent-orchestrator/packages/plugins
prateek 128b94a932
fix: cache ps output across sessions to fix 51s dashboard load (#244)
* fix: cache ps output across sessions to fix 51s dashboard load

findClaudeProcess() was calling `ps -eo pid,tty,args` once per session.
On machines with ~1150 processes, each `ps` call takes 30-35s. With 18
sessions enriched in parallel, this caused /api/sessions to take 51+
seconds despite the 2s per-session timeout.

Add a module-level TTL cache (5s) with in-flight deduplication so `ps`
is called at most once regardless of session count. Also reduce timeouts
from 30s to 5s — stale process data isn't useful.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: guard ps cache callbacks against stale overwrites

The .then() and catch callbacks in getCachedProcessList() could clobber
a newer in-flight cache entry if the TTL expired and a new request
replaced psCache while the old one was still pending. Both now check
`psCache?.promise === promise` before writing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:41:03 +05:30
..
agent-aider feat(web): redesign dashboard, session detail, and orchestrator terminal (#125) 2026-02-20 18:43:57 +05:30
agent-claude-code fix: cache ps output across sessions to fix 51s dashboard load (#244) 2026-03-01 20:41:03 +05:30
agent-codex perf(agent-codex): cache findCodexSessionFile to avoid double scan 2026-02-25 16:25:24 +05:30
agent-opencode feat(web): redesign dashboard, session detail, and orchestrator terminal (#125) 2026-02-20 18:43:57 +05:30
notifier-composio feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
notifier-desktop feat: publish to npm under @composio scope (#32) 2026-02-15 04:28:57 +05:30
notifier-slack feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
notifier-webhook feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
runtime-process feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
runtime-tmux feat: first-class orchestrator session + file-based system prompt (#101) 2026-02-18 19:32:35 +05:30
scm-github fix: migrate to hash-based project isolation architecture 2026-02-18 00:19:55 +05:30
terminal-iterm2 feat: publish to npm under @composio scope (#32) 2026-02-15 04:28:57 +05:30
terminal-web feat: publish to npm under @composio scope (#32) 2026-02-15 04:28:57 +05:30
tracker-github feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
tracker-linear feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
workspace-clone fix: destroy old runtime before restore, cleanup clone on failure (#109) 2026-02-19 01:35:49 +05:30
workspace-worktree feat: implement session restore for crashed/exited agents (#104) 2026-02-19 01:12:57 +05:30