Repository navigation
fix: honor CLI settle timeout - #304
Conversation
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. |
|
Warning Review limit reachedYou'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. View limit details
No actionable comments were generated in the recent review.
|
| 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:
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: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
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.
Comment @coderabbitai help to get the list of available commands.
| if (parsed.settleMs > 2147483647) | ||
| throw new Error('--settle-ms needs an integer >= 0 and <= 2147483647'); |
There was a problem hiding this 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.
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.
Summary
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
a570c32versus the PR fix, on the same Apple M4 Pro / Playwright 1.63.0 / bundled Chromium 153, with identical synthetic pages served on127.0.0.1—not public or production websites. Setup is excluded; the session row measures open → navigate → close. Negative change means faster.audit_keyboard (12 tabs)browser_click (ref + snapshot)browser_hover (ref + snapshot)browser_press_keybrowser_select_optionbrowser_evaluatebrowser_resizebrowser_emulate_mediabrowser_type (ref, fill only)browser_click(settle=1000 ms)browser_navigate (cold browser)browser_session (open, navigate, close)scan_page_matrix (3 variants)browser_take_screenshotbrowser_snapshot (heavy page)browser_take_screenshot (full page)browser_fill_form (2 fields)browser_navigate (heavy page)browser_wait_for (already visible)audit_screen_readerbrowser_tabs (list)browser_network_requestsbrowser_console_messagestools/listbrowser_findbrowser_navigate_backaudit_site (6 pages, depth 3)scan_page (axe)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
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.
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.