Repository navigation
fix(browser): reject overflowing scenario timers - #3515
gensokyo-dev merged 2 commits into
Conversation
…ts (morluto#3392) Add MAX_BROWSER_SCENARIO_TIMEOUT_MS (2^31 - 1 = 2,147,483,647) and enforce .max(MAX_BROWSER_SCENARIO_TIMEOUT_MS) on stepBase.timeout_ms and wait_for_timeout.duration_ms in src/domain/browserScenarioValues.ts. This prevents oversized values from causing TimeoutOverflowWarning in Node.js and prematurely triggering timers after 1 ms. Fixes morluto#3392.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[High impact] The timer fix appears safe to merge; no new blocking issue was established. SummaryCaps browser scenario
Reviews (2) · Last reviewed commit: "fix(browser): qualify timer bounds acros..." · Reviewed by Greptile |
|
TL;DR: The fix works. On current main the new test fails, and with this change it passes. Only one test file ran, and no real CI build or test ran. Tested pull request 3515 on top of main 62bf098 (#4169), using the one new test case.
The new case is the one that fails before the fix. Main accepted a CI: the PR shows 3 checks, all green. They are a Greptile review, "PR readiness" (its text says the CI gate is retired) and the author declaration. No build or test job ran there, so this local run is the only test evidence I have seen. Not run
Thanks, Sagar Kewat, for the fix and the boundary test. Test setup
CommandsThe patch applied to main with an offset of 7 lines and no rejects. The test hunk was skipped because the test file was already in place. 🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Post-merge attribution update: Post-merge CI assessment: 34 latest-head checks succeeded; shard 5 failed only |
Summary
Fixes #3392. Browser scenarios admitted
2_147_483_648ms even though the underlying timers cannot represent it. On pinned maincf5194f68, real Chromium completed that wait in 24 ms and failed an already-visible button deadline in 42 ms, both with timer-overflow warnings.The shared scenario contract now rejects action
timeout_msand waitduration_msabove 2,147,483,647 ms before browser launch. The maximum representable value and omitted action deadlines remain valid. One private constant owns the physical limit; CLI, MCP and the provider consume the same contract. No new cache, provider authority or execution path is introduced.The weak bare-throw assertions are replaced by precise Zod issue code/maximum/path checks, positive boundary/omission checks, and real CLI/stdio-MCP validation in full and compact schema profiles. Compact intentionally elides nested action constraints from its advertised projection; the canonical server schema still rejects them. CLI errors retain structured paths/bounds. MCP's existing SDK error normalization retains field/limit text and recovery guidance but can flatten structured paths; this PR preserves that existing projection.
Executed validation
Linux x64, Node 24.18.0, npm 11.16.0, Playwright 1.58.2, Chrome for Testing 156.0.8078.4:
npm run checkpasses after the final typed test update.docs:checkpasses, including 5 consistency tests.e2573fb6f477c2d3bebc42a2c828235108ae9c73): the same 12 tests pass, and real Chromium MCP again completes both tasks, exports Evidence and confirms cleanup (18.757 s total, 18.484 s CPU, 1,296.7 MiB peak).invalid_request, zero browser launches and zero page requests. The maximum wait remains pending for over one second, then returns cancelled partial observations with confirmed browser/profile cleanup. This does not claim completion of a multi-day wait.All raw captures, schemas and profiler receipts are retained locally; only compact summaries reach the agent. Original macOS/Node 26 behavior was not separately exercised. An initial compact-profile probe incorrectly assumed nested constraints were advertised; it is retained as a failed harness attempt and excluded from completed-task comparisons.
Performance and context
One CPU, 8-GiB hard / 7-GiB early family memory bounds, no swap. Complete SDK tasks include catalog discovery, two successful captures, Evidence export and close:
OS caches and shared-host load are uncontrolled. The opposite timing changes between profiles establish no general speedup or stable latency effect; slower samples remain included. CLI qualification bundles cost 35.063 / 22.892 s, CPU 25.724 / 20.363 s, peak 883.0 / 546.1 MiB (main/candidate). Those bundles include intentionally different overflow outcomes, so their totals are not equivalent healthy-workflow speed comparisons. All completed controls confirm cleanup and no OOM.
cl100k_baseestimates: selected input schema 4,924 / 4,908 tokens in full mode and 344 / 344 in compact mode. A name/description/inputSchema-only catalog proxy is 194,414 / 194,398 full and 44,607 / 44,607 compact. URL-only capture text is about 1,801–1,814 tokens. Captured post-connect JSON messages, including output schemas and export, total 872,343 / 872,368 full and 722,369 / 722,348 compact. These are serialized-protocol/proxy estimates, not actual model context or usage; initialization outside capture hooks and downstream prompts are unmeasured.CI/review assessment and authorized bypass
Latest head
d1c71f41: Codex review completes with no findings. The original Greptile test-oracle thread is fixed and resolved with source/public-boundary/native verification. Its latest-head run now completes with 5/5. GitHub required fork-workflow approval, which was supplied; current classification, readiness and title jobs remain queued without a runner. No latest-head CI test result is claimed.The task owner explicitly authorized bypass when the PR is independently qualified. The decision uses completed full checks, documentation, 12 targeted tests, 12 newer-main integration tests, real CLI regression/controls and real MCP workflows in both schema profiles. Pending CI results remain visible and will be assessed when available. Main advanced from the integrated
57e76599cto55cce6fc1with only an unrelated CLI test update; production workflow code is unchanged.Post-merge CI assessment: 34 latest-head checks succeeded; shard 5 failed only
jsonOutputOwnership.test.ts/preserves cancellation when staging cleanup also failsatwriter.close(), with unexpected staging entries. Exact filtered controls reproduce the same failure on pre-change maincf5194f68and candidated1c71f41; the test and staging-cleanup producers are outside this diff. Other shards were cancelled after that failure. This is an existing main failure, not a passing full CI claim; no unrelated repair is included.Author readiness
Human owner: @gensokyo-dev
The task owner explicitly delegated validation, readiness declarations and merge to this agent. These declarations are supplied under that authorization; no separate new manual human review by the original author is asserted.
Before merge