Repository navigation
perf(orcad): keep SSH hosts on the 10-minute scanner idle, give WSL hosts 3 - #33897
Conversation
|
No actionable comments were generated in the recent review.
|
c54f6e2 to
61c1cd3
Compare
…y tests The first test paid the cold transform of the whole runtime graph inside its 30 s budget and timed out whenever a shard placed it without warm neighbors.
…osts 3 Retiring the idle session scanner after a minute cost the next scan of a large history ~14 s. SSH hosts have no memory budget to justify that, so they return to the scanner's default; WSL hosts, which do, wait 3 minutes.
61c1cd3 to
4e1b3fe
Compare
ELI5
#33845 made the Orca server shut its session-history helper down after 1 minute of idle, on every host. That saves memory, but on a large history it makes the next session-list scan about 14 s slower. That's worth it for WSL, where memory is tight, but not for SSH hosts. Now WSL hosts wait 3 minutes and SSH hosts go back to the original 10 minutes.
What Changed
isWslHostOrcadProcesscheck: only WSL launches setORCA_WSL_ORCAD_HOST=1, and the process must actually be running in WSL.orcad-session-scanner-idle.ts, so it can be tested without booting orcad.Why
I measured the cost of a retire on a large real history (2 years of Claude and Codex sessions, more than 1000 sessions, on a heavily loaded Mac), using the pinned runtime and the built scanner bundle:
A retire adds about 14 s (×1.46) to the next scan on a big history.
Not addressed here: closing the cold-scan gap itself by persisting more scan state. The warm child also holds in-memory indexes (for example the Codex title index, cursor chat meta and project cwd caches) on top of the persisted parse cache. Finding which of them account for the 14 s needs a CPU profile of a cold scan; that's a follow-up.
Linked Issue
Internal WSL host memory work; follow-up to #33845.
Visual Proof
N/A: no UI change. Only how long an idle background process lives on a host server.
Testing
New
orcad-session-scanner-idle.test.ts: WSL hosts get 180 s, SSH hosts get no override (null).session-scanner-service-spawn.test.ts, which checks the configured timeout reaches the shared client, andmain-preflight-order.test.tspass underpnpm test.pnpm lintandpnpm tc:nodepass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)