Repository navigation
Clamp the bash foreground timeout to the 32-bit timer limit - #438
Merged
Merged
Conversation
With BASH_DEFAULT_TIMEOUT_MS=3000000000, or a BASH_MAX_TIMEOUT_MS and a requested timeout above 2147483647 ms, foregroundLimitMs returned the value unbounded: - with a UI, setTimeout overflowed and fired after 1 ms, so `echo a; sleep 2; echo b` returned "Command did not complete within its 3000000s timeout and was moved to the background" at once, with a TimeoutOverflowWarning; - without a UI, the value reached pi's bash as seconds and every call failed with "Invalid timeout: maximum is 2147483.647 seconds". foregroundLimitMs now returns at most 2147483647 ms, the largest timeout the timer and pi's bash accept, so an oversized value runs the command as Claude Code does. The schema text then states 2147483.647 seconds.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



foregroundLimitMsinextensions/background-bash.tshad no upper bound, so a timeout above 2147483647 ms reachedsetTimeoutand pi's built-in bash unchanged.With
BASH_DEFAULT_TIMEOUT_MS=3000000000and the commandecho a; sleep 2; echo b:TimeoutOverflowWarninga\nbInvalid timeout: maximum is 2147483.647 secondsa\nbThe same was reachable with a large
BASH_MAX_TIMEOUT_MSand a large model-suppliedtimeout.The limit is now capped at 2147483647 ms, the longest delay a timer holds and the largest timeout pi's bash accepts. Claude Code 2.1.325 accepts the same value and runs the command normally.
npm run checkpasses (Biome, strict tsc, Vitest)