Skip to content

Commit d42ae75

Browse files
mabry1985Automakerclaude
authored
fix(core): bump stream stall watchdog default to 5 min (#155)
Long agentic turns (parallel subagent dispatch, deep mid-stream planning pauses) were tripping the 90 s per-chunk idle watchdog and surfacing as "Stream stalled: no data received for 90s" even on healthy connections. Bump the default to 300 s — still catches genuine frozen connections, but gives legitimate slow-but-steady streams the headroom they need. PROTO_STREAM_STALL_TIMEOUT_MS env override unchanged. Co-authored-by: Automaker <automaker@localhost> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 71e734f commit d42ae75

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

docs/reference/settings.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ In addition to `settings.json`, the `.proto/` directory can contain:
8484

8585
These variables take effect at runtime and do not require a settings file entry.
8686

87-
| Variable | Default | Description |
88-
| ------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
89-
| `PROTO_STREAM_STALL_TIMEOUT_MS` | `90000` | Max ms to wait between streaming chunks before the stall watchdog fires (throws a retryable error). Increase if complex agentic responses are hitting the limit. |
90-
| `PROTO_SYSTEM_DEFAULTS_PATH` || Override path to the system defaults settings file |
91-
| `PROTO_SYSTEM_SETTINGS_PATH` || Override path to the system settings override file |
87+
| Variable | Default | Description |
88+
| ------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
89+
| `PROTO_STREAM_STALL_TIMEOUT_MS` | `300000` | Max ms to wait between streaming chunks before the stall watchdog fires (throws a retryable error). Increase if complex agentic responses are hitting the limit. |
90+
| `PROTO_SYSTEM_DEFAULTS_PATH` | | Override path to the system defaults settings file |
91+
| `PROTO_SYSTEM_SETTINGS_PATH` | | Override path to the system settings override file |
9292

9393
### `modelProviders`
9494

packages/core/src/core/turn.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ import { withChunkTimeout, StreamStallError } from '../utils/streamStall.js';
3737

3838
/**
3939
* Max ms to wait between individual stream chunks before declaring a stall.
40-
* 90 s gives complex agentic responses (e.g. parallel subagent dispatch)
41-
* enough room for Gemini's mid-stream planning pauses while still catching
42-
* genuine frozen connections well before the 120 s SDK timeout.
40+
* 5 min gives complex agentic responses (e.g. parallel subagent dispatch
41+
* and long mid-stream planning pauses) ample headroom while still catching
42+
* genuine frozen connections.
4343
* Override via PROTO_STREAM_STALL_TIMEOUT_MS env var.
4444
*/
4545
const STREAM_STALL_TIMEOUT_MS = parseInt(
46-
process.env['PROTO_STREAM_STALL_TIMEOUT_MS'] ?? '90000',
46+
process.env['PROTO_STREAM_STALL_TIMEOUT_MS'] ?? '300000',
4747
10,
4848
);
4949

0 commit comments

Comments
 (0)