()
| 118 | } |
| 119 | |
| 120 | function resolveBusyTimeoutMs(): number { |
| 121 | const raw = process.env.CODEGRAPH_QUERY_BUSY_TIMEOUT_MS; |
| 122 | if (raw === undefined || raw === '') return DEFAULT_BUSY_TIMEOUT_MS; |
| 123 | const n = Number(raw); |
| 124 | if (!Number.isFinite(n) || n < 1000) return DEFAULT_BUSY_TIMEOUT_MS; |
| 125 | return Math.floor(n); |
| 126 | } |
| 127 | |
| 128 | /** Success-shaped overload guidance (NEVER isError — see the abandonment rule). */ |
| 129 | function busyGuidance(waitedMs: number): ToolResult { |