Skip to content

fix: honor CLI settle timeout - #304

Merged
JustasMonkev merged 4 commits into
mainfrom
fix/settle-timeout-flow-benchmarks
Oct 28, 2026
Merged

JustasMonkev merged 4 commits into
mainfrom
fix/settle-timeout-flow-benchmarks

Conversation

@JustasMonkev

@JustasMonkev JustasMonkev commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

 --timeout-settle <ms>
   Commander: timeoutSettle
-  config reads settleTimeout → CLI value ignored
+  config reads timeoutSettle → requested delay applied

Only the timeout fix, a property-name correction in the existing config test, and a README clarification remain. No new tests are included. No benchmark scripts, benchmark tests, or measurement files are changed in this PR. Existing repository benchmarks are left untouched.

Evidence

Which actions are faster or slower?

Same requested setting before and after: --timeout-settle 0, except the explicitly marked 1000 ms row. Before the fix, the CLI flag was ignored and the effective delay stayed at 500 ms. After the fix, the requested value is honored. The default remains 500 ms; these are not default-performance gains.

Medians from 3 timed samples after 1 warmup, unchanged base a570c32 versus the PR fix, on the same Apple M4 Pro / Playwright 1.63.0 / bundled Chromium 153, with identical synthetic pages served on 127.0.0.1—not public or production websites. Setup is excluded; the session row measures open → navigate → close. Negative change means faster.

Action Before (ms) After (ms) Change Result
audit_keyboard (12 tabs) 7384.4 76.5 -99.0% Faster
browser_click (ref + snapshot) 664.5 44.0 -93.4% Faster
browser_hover (ref + snapshot) 678.0 57.9 -91.5% Faster
browser_press_key 643.1 23.4 -96.4% Faster
browser_select_option 649.1 31.8 -95.1% Faster
browser_evaluate 633.2 21.9 -96.5% Faster
browser_resize 608.6 3.6 -99.4% Faster
browser_emulate_media 608.3 4.2 -99.3% Faster
browser_type (ref, fill only) 624.6 22.5 -96.4% Faster
browser_click (settle=1000 ms) 672.7 1183.3 +75.9% Slower by request
browser_navigate (cold browser) 331.9 316.6 -4.6% Small variation
browser_session (open, navigate, close) 163.9 153.5 -6.3% Small variation
scan_page_matrix (3 variants) 1589.6 1585.5 -0.3% Small variation
browser_take_screenshot 40.7 37.3 -8.3% Small variation
browser_snapshot (heavy page) 20.2 17.9 -11.7% Small variation
browser_take_screenshot (full page) 89.9 88.1 -2.1% Small variation
browser_fill_form (2 fields) 42.2 40.8 -3.5% Small variation
browser_navigate (heavy page) 41.8 40.7 -2.7% Small variation
browser_wait_for (already visible) 20.9 20.7 -0.8% Small variation
audit_screen_reader 32.2 32.1 -0.4% Small variation
browser_tabs (list) 0.8 0.7 -7.3% Small variation
browser_network_requests 0.8 0.7 -7.4% Small variation
browser_console_messages 0.9 0.9 -3.2% Small variation
tools/list 1.4 1.5 +5.0% Small variation
browser_find 18.2 18.4 +0.8% Small variation
browser_navigate_back 15.9 16.7 +5.1% Small variation
audit_site (6 pages, depth 3) 2195.6 2200.2 +0.2% Small variation
scan_page (axe) 267.2 273.7 +2.4% Small variation

Reading the table: nine actions become clearly faster when zero settling is requested. Requesting 1000 ms makes clicking slower by design. Other changes are under 10 ms or 10%, labeled “Small variation” rather than claimed improvements/regressions; three samples are not a statistical significance test. Site/matrix extra waits are separate settings and remain unchanged.

Correctness tradeoff: zero settling returned before a deliberately delayed DOM update; default settling captured it. Use zero only when the caller explicitly handles page readiness. The faster times do not mean equivalent readiness guarantees.

Validation

  • Before: the regression returned the environment's 250 ms instead of the CLI-requested 100 ms.
    After: the existing config test uses the corrected property name. Seven earlier real CLI/MCP probes verified file/environment/CLI precedence and eventual DOM completion on synthetic localhost pages. The newly added automated cases were removed as requested.
  • Final reduced-PR gate: 1,849 tests passed, 5 skipped. Build, lint/typecheck, slop-check, and diff checks passed.
  • Measurements were run outside the PR. No dependency changes or unrelated Playwright-alpha upgrade are included.

Merge Danger

Door: two-way

Revert the commit(s); no migration.

Blast Radius: CLI

Explicit delays previously ignored now take effect: lower values can return earlier, higher values wait longer. Default behavior is unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

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-10-28T17:00:10.895271Z ac743c7 New commits
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3796240b-e562-453f-9c7b-2b8213ea603e
Commits

Reviewing files that changed from the base of the PR and between 57ebe93 and ac743c7.

Files selected for processing: 2
  • README.md
  • tests/config.test.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3938b19c-2516-448f-abd3-17e9d4f2c555
Commits

Reviewing files that changed from the base of the PR and between a570c32 and 57ebe93.

Files selected for processing: 6
  • README.md
  • bench/mcp-bench.mjs
  • src/config.ts
  • tests/bench.test.ts
  • tests/config.test.ts
  • tests/program.test.ts

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

Walkthrough

The CLI settle-time option is renamed internally and remains configurable through the same environment variable. The benchmark adds settle-delay validation, audit and browser scenarios, result checks, and startup timing in its report.

Changes: Benchmark updates

Layer / File(s) Summary
Settle-time configuration
src/config.ts, bench/mcp-bench.mjs, tests/config.test.ts, tests/program.test.ts, tests/bench.test.ts, README.md
The CLI option changes from settleTimeout to timeoutSettle. The benchmark accepts a nonnegative integer delay, passes it to the server, and uses 500 ms by default. Tests cover defaults, environment values, CLI overrides, zero, and invalid values.
Benchmark scenarios and verification
bench/mcp-bench.mjs, README.md
The benchmark adds audit, scan-matrix, browser-tool, form, click, navigation, and browser-session scenarios. Audit and matrix results receive checks, and the fixture server handles the failed-request scenario.
Benchmark timing and report
bench/mcp-bench.mjs
The benchmark measures client connection startup and records startup duration and settle time in the report.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: claude

Merge Risk: Minimal · previous review 57ebe

The settle-time option is wired to configuration, and no merge-blocking issue was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed 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 with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check Passed The title clearly and concisely describes the primary change: correcting CLI settle-timeout handling. It is related to the main implementation changes, although it does not mention the added benchmark…
Full details: Title check

Explanation

The title clearly and concisely describes the primary change: correcting CLI settle-timeout handling. It is related to the main implementation changes, although it does not mention the added benchmark verification.

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 with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Comment thread bench/mcp-bench.mjs Outdated
Comment on lines +511 to +512
if (parsed.settleMs > 2147483647)
throw new Error('--settle-ms needs an integer >= 0 and <= 2147483647');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 This check never rejects anything

wholeNumber reads parsed.settleMs, but parsed is a number. The comparison always sees undefined, so this branch never throws. That makes the helper look like it enforces a limit that it cannot enforce. Remove these two lines; parseArgs already checks the settle limit correctly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: bench/mcp-bench.mjs
Line: 511-512

Comment:
**This check never rejects anything**

`wholeNumber` reads `parsed.settleMs`, but `parsed` is a number. The comparison always sees `undefined`, so this branch never throws. That makes the helper look like it enforces a limit that it cannot enforce. Remove these two lines; `parseArgs` already checks the settle limit correctly.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@JustasMonkev JustasMonkev changed the title fix: honor settle timeout and verify browser performance flows fix: honor CLI settle timeout Oct 28, 2026
@JustasMonkev
JustasMonkev merged commit 7b628de into main Oct 28, 2026
12 of 13 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