#11416: fix: clamp timeout values to avoid 32-bit overflow warning
agents
Cluster:
Timeouts and Memory Management Fixes
Fixes TimeoutOverflowWarning by clamping timeout values to MAX_SAFE_TIMEOUT_MS (2147483647).
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates agent timeout normalization to avoid Node.js `TimeoutOverflowWarning` by clamping all computed timeout values to the maximum safe `setTimeout` duration (2,147,483,647 ms). It replaces the previous “no timeout” sentinel (30 days) with that maximum-safe value and ensures negative overrides (meaning “use default”) also get clamped.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Change is narrowly scoped to timeout value normalization and consistently clamps all timeout paths to Node’s maximum safe `setTimeout` value, eliminating the overflow warning without altering behavior for typical (small) timeouts.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#10636: fix: setTimeout integer overflow causing server crash
by devmangel · 2026-02-06
87.5%
#9114: Fix: Reduce NO_TIMEOUT_MS to 24 days to avoid Node.js overflow warning
by vishaltandale00 · 2026-02-04
86.6%
#12477: fix(agents): prevent TimeoutOverflowWarning when timeout is disabled
by skylarkoo7 · 2026-02-09
83.7%
#11752: fix(heartbeat): clamp setTimeout delay to 2^31-1 to prevent Timeout...
by kjaylee · 2026-02-08
77.7%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
75.4%
#21661: fix(agents): treat approval timeout as denial regardless of askFall...
by AI-Reviewer-QS · 2026-02-20
74.0%
#16176: Fix Groq TPM limits misidentified as context overflow
by dddabtc · 2026-02-14
74.0%
#6111: fix: detect float underflow in duration parsing
by T1mn · 2026-02-01
73.9%
#22719: fix(agents): make subagent announce timeout configurable (restore 6...
by Valadon · 2026-02-21
73.9%
#4243: fix: resolve Node.js punycode deprecation warning
by dylanneve1 · 2026-01-29
73.8%