* Per-attempt timeout for non-streaming fallback requests, in milliseconds. * Reads API_TIMEOUT_MS when set so slow backends and the streaming path * share the same ceiling. * * Remote sessions default to 120s to stay under CCR's container idle-kill * (~5min) so a hung fallback to a wedged back
()
| 805 | * approaching the API's 10-minute non-streaming boundary. |
| 806 | */ |
| 807 | function getNonstreamingFallbackTimeoutMs(): number { |
| 808 | const override = parseInt(process.env.API_TIMEOUT_MS || '', 10) |
| 809 | if (override) return override |
| 810 | return isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) ? 120_000 : 300_000 |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * Helper generator for non-streaming API requests. |
no test coverage detected