doudouOUC fe6c8bd5d6 fix(core): add configurable bodyTimeout to prevent streaming timeout with local models
Node.js built-in fetch uses undici's default 300s bodyTimeout between SSE
chunks. Local model servers (Ollama, mlx_lm.server) generating tool call
JSON can pause longer than this, causing "Body Timeout Error". The proxy
and Bun paths already disabled this timeout but the no-proxy Node.js path
did not.

Add `generationConfig.bodyTimeout` (default 0 = disabled) so all Node.js
paths now use a plain undici Agent with configurable body timeout. Invalid
values are sanitized at runtime. Proxy-failure fallback also preserves the
user's bodyTimeout setting.

Fixes #4604
Fixes #4657
2026-06-01 11:49:20 +08:00
..
2026-05-29 18:02:11 +08:00