{"version":"2.1.126","anchor":"streaming-idle-timeout-calculation-extracted-into-a-helper","canonical_anchor":"streaming-idle-timeout-calculation-extracted-into-a-helper","heading":"Streaming idle-timeout calculation extracted into a helper","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.126\/e\/streaming-idle-timeout-calculation-extracted-into-a-helper","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.126","markdown":"### Streaming idle-timeout calculation extracted into a helper\n\n**What**\n\nThe logic that decides how long the SSE\/streaming HTTP layer waits before declaring an idle stream dead has been pulled into its own function. Behavior is effectively unchanged \u2014 both before and after, the timeout is the maximum of the user's `CLAUDE_STREAM_IDLE_TIMEOUT_MS` env var and a 300000 ms (5 minute) floor.\n\n**Details**\n\n- Previous inline expression: `Math.max(parseInt(process.env.CLAUDE_STREAM_IDLE_TIMEOUT_MS || \"\", 10) || 90000, 300000)`.\n- New helper: `Math.max(Number(process.env.CLAUDE_STREAM_IDLE_TIMEOUT_MS) || 0, 300000)`.\n- The 90000 fallback in the old version was always dominated by the 300000 floor, so the 5-minute minimum is preserved.\n- The env var continues to behave the same: setting `CLAUDE_STREAM_IDLE_TIMEOUT_MS` above 300000 raises the timeout; values at or below 300000 are clamped to the 5-minute floor.\n\nThis is mostly an internal cleanup, but documented here because `CLAUDE_STREAM_IDLE_TIMEOUT_MS` is a user-configurable env var \u2014 its semantics are unchanged in this release.\n\n**Evidence**\n\nNew function returning the timeout (search for `\"CLAUDE_STREAM_IDLE_TIMEOUT_MS\"`); call site previously had the inline `Math.max(...)` expression and now invokes the helper."}