Problem
In src/runners/cc-agents-discovery.ts, the discoverCcAgents() function uses options.timeoutMs ?? DEFAULT_TIMEOUT_MS (line 141) for the timeout option to execFileAsync, but DEFAULT_TIMEOUT_MS is defined as 10_000 (10s).
However, detectCcVersion() (line 102) has its own hardcoded timeout: 5000 (5s). If discoverCcAgents is called with timeoutMs: 3000, the version check still takes up to 5s, which exceeds the caller's intended timeout.
Additionally, there is no signal-based cancellation — if the claude agents --json command hangs beyond the timeout, the process is killed by Node but error handling assumes a clean message.
Fix
- Pass
timeoutMs through to detectCcVersion as well, or derive version-check timeout from the caller timeout
- Consider using
AbortController for cancellation propagation
Impact
Discovered during
Code quality sweep on src/runners/ (pre-#3180 audit).
Problem
In
src/runners/cc-agents-discovery.ts, thediscoverCcAgents()function usesoptions.timeoutMs ?? DEFAULT_TIMEOUT_MS(line 141) for thetimeoutoption toexecFileAsync, butDEFAULT_TIMEOUT_MSis defined as10_000(10s).However,
detectCcVersion()(line 102) has its own hardcodedtimeout: 5000(5s). IfdiscoverCcAgentsis called withtimeoutMs: 3000, the version check still takes up to 5s, which exceeds the caller's intended timeout.Additionally, there is no signal-based cancellation — if the
claude agents --jsoncommand hangs beyond the timeout, the process is killed by Node but error handling assumes a clean message.Fix
timeoutMsthrough todetectCcVersionas well, or derive version-check timeout from the caller timeoutAbortControllerfor cancellation propagationImpact
Discovered during
Code quality sweep on
src/runners/(pre-#3180 audit).