Repository navigation
fix: read scientific notation in run_end_ceiling_ms as the CLI does - #1361
Open
NovaCode37 wants to merge 1 commit into
Open
NovaCode37 wants to merge 1 commit into
NovaCode37 wants to merge 1 commit into
Conversation
sigley
approved these changes
Oct 7, 2026
sigley
left a comment
There was a problem hiding this comment.
Validated exact head eaf417f against the issue acceptance boundary. Integral scientific notation now parses as intended (including 1e6 and 1e2), 0e19 preserves the zero/no-limit semantics, fractional and non-finite spellings are rejected, and very large plain integer strings keep exact precision. The branch merges cleanly with current main; tests/test_query.py passes 103/103 and compile/diff checks are clean. I do not see a blocking correctness issue in this approach.
This branch has not been deployed
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.
Fixes #1359
run_end_ceiling_ms()documents that it readsCLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS"as the CLI will see it", but it parsed the value withint(), so1e6was rejected and silently fell back to the 10 minute default. The SDK then closed stdin on a different schedule than the caller configured.This takes option 1 from the issue: a plain integer is still parsed with
int(), so a very large value keeps the exact precision a float round-trip would cost it, and only when that fails does the value go throughfloat()to pick up the integral scientific notation the CLI reads.A value that is not finite or not integral is rejected rather than truncated. That is deliberate: truncating would turn
0.5into0, and0is the spelling that means "no limit", so a user asking for a sub-millisecond ceiling would get an unbounded one instead.Behavior kept as it was: unset and empty fall back to the default,
0still means no limit, whitespace around a plain integer is still accepted, invalid and negative values still fall back to the default, and a huge integer string is still honored exactly and clamped later by the sleeper.Tests
Added nine cases to
TestRunEndCeilingFromEnv.test_parse, covering1e6and1e2from the issue, uppercase1E3with whitespace, scientific notation coming from the ambient environment, and the rejections (-1e6,1.5,0.5,inf,nan), plus a 25-digit integer to pin the exactness.pytest tests/test_query.pypasses (103 tests), andruffandmypyare clean.