Skip to content

fix: gateway stream idle timeout honors KIN_STREAM_IDLE_TIMEOUT (#485) - #506

Merged
dofastted merged 1 commit into
mainfrom
cursor/stream-idle-timeout-env-485-5dd6
Oct 17, 2026
Merged

dofastted merged 1 commit into
mainfrom
cursor/stream-idle-timeout-env-485-5dd6

Conversation

@dofastted

@dofastted dofastted commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #485: the gateway /v1 stream path used Number(cfg.limits.stream_idle_timeout_ms) || 180_000 as the fallback to streamIdleTimeoutMs(), which skipped KIN_STREAM_IDLE_TIMEOUT whenever cfg.limits was missing or non-finite.

  • Add resolveStreamIdleTimeoutMs(routing, cfg) with cascade: panel failover.stream_idle_timeout_ms → cfg.limits.stream_idle_timeout_ms → KIN_STREAM_IDLE_TIMEOUT → 180_000 ms (unchanged default).
  • Wire handle-protocol.mjs through that helper (same path vm-runtime.mjs / kernel already use via streamIdleTimeoutMs(routing)).
  • Document cascade in docs/PANEL_API.md and panel 「流空闲超时」tip.
  • Regression tests in test/unit/routing-file.test.mjs.

Out of scope (per product decision)

  • Default remains 180s; no thinking-aware idle detection; no VERSION / tip-cut changes.

Test plan

  • node --test test/unit/routing-file.test.mjs
  • npm run format:check (Biome + web Prettier)
  • npm run test:unit — 5 pre-existing failures on main (database, egress, legacy-import, oauth-binary, session-oauth-seam); unrelated to this change
Open in Web Open in Cursor 

Note

Low Risk
Config-resolution bugfix on the gateway stream path only; default 180s unchanged and behavior is covered by unit tests.

Reviewed by Cursor Bugbot for commit 554569a. Configure here.

@dofastted
dofastted marked this pull request as ready for review October 17, 2026 09:51
Unify stream idle timeout resolution through resolveStreamIdleTimeoutMs()
so handle-protocol no longer hardcodes 180_000 as fallback and skips env.

Document cascade in PANEL_API and panel UI tip; add regression tests.

Co-authored-by: ted <kuhlmangarry24@gmail.com>
@cursor
cursor Bot force-pushed the cursor/stream-idle-timeout-env-485-5dd6 branch from dd196d7 to 554569a Compare October 17, 2026 09:52
@dofastted
dofastted merged commit 48cb1cb into main Oct 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

idle_timeout_seconds 默认 180 秒会杀掉高强度思考请求

2 participants