Skip to content

fix(config): 运行时超时参数收紧为整数毫秒 - #1783

Merged
deepcoldy merged 1 commit into
deepcoldy:masterfrom
kunshanyep-beep:fix/runtime-timeout-integers
Oct 11, 2026
Merged

deepcoldy merged 1 commit into
deepcoldy:masterfrom
kunshanyep-beep:fix/runtime-timeout-integers

Conversation

@kunshanyep-beep

Copy link
Copy Markdown
Contributor

改了什么

  • 复用现有 parseBoundedInteger,仅接受 1..2147483647 范围内的整数运行时超时。
  • 补齐最小值 1 与最大值 2147483647 的接受断言。
  • 将原有小数接受用例改为整数,并补充 0.5、1.9 回退默认值的回归覆盖。

为什么

非整数毫秒会在卡顿检测的 setTimeout 中被运行时截断,0~2ms 的小数可能退化为约 1ms 的反复触发;Node 的 AbortSignal.timeout 还会直接拒绝非整数并让 AI 分支名请求静默回退。统一按整数解析可以避免这两种不一致行为。

影响面

  • 仅改变 STUCK_DETECTOR_TIMEOUT_MS 与 BOTMUX_WORKTREE_SLUG_AI_TIMEOUT_MS 的非法小数输入处理:现在回退到原有的 45 秒与 5 秒默认值。
  • 合法正整数、未配置时的默认值、CLI/后端/会话状态逻辑均不变。

验证

  • npx -y [email protected] run test -- test/runtime-timeout-config.test.ts test/stuck-detector.test.ts test/worktree-slug-ai.test.ts(47/47)
  • npx -y [email protected] run build
  • git diff --check

Closes #1747

@deepcoldy
deepcoldy merged commit ea76d77 into deepcoldy:master Oct 11, 2026
7 of 10 checks passed
@github-actions

Copy link
Copy Markdown

🚀 Released in v3.42.0

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.

fix(config): 运行时超时参数收紧为整数毫秒(#1737 follow-up)

2 participants