Align MCP browser pools with durable API contracts - #139
Conversation
Align MCP validation and update clear semantics with the current browser-pool API, and report resolved profile and extension identifiers in compact output.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
masnwilliams
left a comment
There was a problem hiding this comment.
the contract fixes are needed and the behavior looks correct, but i think these two maintainability issues should be addressed before merging. the main concern is keeping PATCH-only clear semantics out of the shared create path; the second is ensuring the new shared test mock is actually isolated between suites.
masnwilliams
left a comment
There was a problem hiding this comment.
both requested changes are addressed: create serialization is strict again with PATCH clears owned by the update path, and the shared Kernel client factory is restored after the browser-pool suite. re-ran the full test suite, typecheck, changed-file formatting, and the cross-suite leak reproduction; all pass.
Summary
Why
The MCP tool lagged the durable browser-pool API contract. Agents could not reliably pause filling, clear configuration, or see the IDs the API actually resolved.
Implementation
The registered MCP surface now enforces integer fill rates, timeout bounds of 10 through 259200 seconds, and update-only empty sentinels. Tests exercise the registered tool rather than exporting implementation helpers.
Verification
bun test(90 tests)bunx tsc --noEmitgit diff --checkNote
Medium Risk
Changes MCP tool input mapping and API payloads for pool create/update (clears, bounds, responses); incorrect mapping could send wrong clears or reject valid agent requests, but scope is limited to browser-pool tooling with strong test coverage.
Overview
Aligns the
manage_browser_poolsMCP tool with the durable browser-pool API so create/update behavior, validation, and responses match what agents need.Create vs update: Empty
start_urlandclear_profile/clear_extensionsare update-only; create rejects them. Updates can clear profile, extensions, proxy (proxy_id: ""),start_url, and Chrome policy ({}) via explicit sentinels, with guards against mixing clears with set profile/extension fields.Validation: Integer
fill_rate_per_minute(min 0) andtimeout_secondsbounded 10–259200;start_urlschema allows""on update. Pool summaries exposeprofile_idandextension_idsfrom the API instead of nested profile/extension objects.Refactor:
buildBrowserSharedConfigextracts shared profile/extensions/viewport building; create still usesbuildBrowserCreateConfigforstart_url. Kernel client test mocks move tokernel-client.test-fixtures; new contract tests cover the registered tool.Reviewed by Cursor Bugbot for commit 08f762c. Bugbot is set up for automated code reviews on this repo. Configure here.