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> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| tsconfig.json | ||