Skip to content

Fix capped browser wait duration reporting - #241

Merged
JustasMonkev merged 1 commit into
mainfrom
fix/wait-for-capped-duration
Sep 26, 2026
Merged

JustasMonkev merged 1 commit into
mainfrom
fix/wait-for-capped-duration

Conversation

@JustasMonkev

@JustasMonkev JustasMonkev commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Upstream change

Ports the reporting fix from microsoft/playwright#42932 (commit microsoft/playwright@afa6836).

Upstream found that browser_wait_for caps the actual delay at 30 seconds but reports and generates replay code for the requested duration. This repository has the same mismatch.

Fix

  • Use the capped duration in the actual timer and generated code.
  • Report seconds and disclose capped requests for time-only waits.
  • Describe the existing cap in the input schema and README.
  • Preserve text/textGone handling and existing input acceptance.
  • Add nine fake-timer regression cases covering fractional delays, the cap, over-cap requests, text waits, and missing conditions.

No dependency, package, binary, or exported tool names change.

Validation

  • Regression red → green: five output/replay assertions failed before the fix; all nine tests pass afterward.
  • Lint/type checking and build pass on current main plus this patch.
  • Simplification scan and diff whitespace checks pass.
  • Full suite: 1,260 passed, one failed. The existing persistent-browser download integration test in tests/history-downloads.integration.test.ts failed when the browser closed during a download. Its isolated rerun also failed; this test does not call browser_wait_for. No unrelated download workaround is included.

Draft pending resolution or CI verification of the existing browser integration failure.

Summary by CodeRabbit

  • Bug Fixes
    • Timed browser waits now consistently use a maximum duration of 30 seconds, including in generated code.
    • Results report the duration used and indicate when a requested wait was shortened to the limit. Text-based wait results continue to take priority when text conditions are provided.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2bfb5a42-ef65-4300-9c4d-e5f1f0f3a1b0

📥 Commits

Reviewing files that changed from the base of the PR and between c8ba4ed and 9ec67fb.

📒 Files selected for processing (3)
  • README.md
  • src/tools/wait.ts
  • tests/tools-wait.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

browser_wait_for caps time-based waits at 30 seconds. Generated code and execution use the capped duration, and time-only results report that duration. New tests cover timing, text waits, and missing conditions.

Changes

Wait duration handling

Layer / File(s) Summary
Cap and report timed waits
src/tools/wait.ts, tests/tools-wait.test.ts, README.md
Time-based waits use a 30-second maximum in generated code and execution. Results report the capped duration. Tests and documentation cover the cap and text-wait behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 9ec67

The capped wait behavior appears ready to merge after normal checks, including verification of the reported integration-test failure.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9ec67

The change makes reported and replayed waits match the existing 30-second execution cap. It does not appear to expand who can invoke the tool or what the tool can access, but the available evidence does not establish complete security coverage.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior affects callers consuming this tool’s result or generated code. The supplied test-only entrypoint signal does not establish additional runtime reachability.

Trust Boundaries and Controls

  • observed — The handler still receives parsed tool arguments through the existing backend dispatch path. The inspected path does not establish the wait tool’s specific authorization policy.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: correcting reporting for the capped browser wait duration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JustasMonkev
JustasMonkev marked this pull request as ready for review September 25, 2026 20:10
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T20:12:48.064262Z 9ec67fb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@JustasMonkev
JustasMonkev merged commit 0be0e64 into main Sep 26, 2026
7 checks passed
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.

1 participant