agent-orchestrator/packages
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-orchestrator feat: publish to npm under @composio scope (#32) 2026-02-15 04:28:57 +05:30
cli test: add tests for --agent override and codex plugin registration 2026-02-24 03:26:54 +05:30
core fix: use JSONL-based activity detection in lifecycle manager (#247) 2026-03-01 20:04:31 +05:30
integration-tests fix: keep Claude Code interactive after initial prompt (#145) 2026-02-27 18:11:06 +05:30
plugins fix: cache ps output across sessions to fix 51s dashboard load (#244) 2026-03-01 20:41:03 +05:30
web fix: WebSocket reconnection in DirectTerminal (#248) 2026-03-01 20:18:07 +05:30