Repository navigation
Add named Playwright executor support - #235
Conversation
Add an optional executor parameter to execute_playwright_code, surface the tab page was bound to in its result, and report the current executors when the browser is at its named executor limit. Add manage_playwright_executors with list and delete actions. Point @onkernel/sdk at a vendored preview build that includes the executors surface.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace the vendored preview tarball with the published package that includes the Playwright executors surface.
2a5368c to
8b6b5b0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8503898. Configure here.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
masnwilliams
left a comment
There was a problem hiding this comment.
approving. the executor plumbing is clean: manage_playwright_executors follows the manage_replays shape, the shared name schema is a nice touch, and gating the 409 on a named call in the latest commit is the right scope. notes below are non-blocking; the first is the one i'd most like before merge.
worth doing before merge:
- the
execute_playwright_codedescription lost two lines when it was aligned with the API spec: "for reusable site actions, checkwebmcp.listTools()first and prefer a suitable structured tool; use playwright when none is exposed" (added in #213 on purpose) and "does not create or delete browsers -- use manage_browsers for session lifecycle" (the README still says this). can we add both back? same thing bugbot flagged on 8503898. separately, the description went from ~300 to ~2.7k chars and some of it (post-timeout process behavior, multi-window active tab, old images) isn't something an agent acts on. trimming is optional, restoring the two lines is the ask.
optional cleanups:
- the fallback note passed to
throwToolErrorWithApiBodyon the 409 never shows: the helper only appends it when the body isn't an object, and the limit error always is. either drop the arg or change the helper if you want the pointer tomanage_playwright_executorsin the error text. JSON.stringifyalready drops undefined fields, so...(response.tab && { tab: response.tab })can betab: response.tab, and the whole hand-built block is equivalent toreturn jsonResponse(response).
follow-ups (fine to skip here):
KERNEL_MCP_ENABLED_TOOLSETS=manage_playwright_executorsthrows unknown (themanage_strip leavesplaywright_executors). one-line fix is adding it tostandaloneToolsetAliasesinregister.ts.- the session-name description in
browsers.tslists the tools that accept a session name assession_id; this one isn't in it. toolResultTextis now duplicated inplaywright.test.tsandbrowsers.test.ts, could live inmcp-test-fixtures.tsnext totoolResultJSON.
Restore the WebMCP-first and manage_browsers lines in the execute description, return the execute response as-is, drop the fallback note the API-body error helper never shows, accept manage_playwright_executors as a toolset alias, list it among the tools that take a session name, and share the toolResultText test helper.
|
thanks for the review. addressed in 53d5d50:
|

Summary
Adds named Playwright executor support to the MCP server, matching the browser API's executor surface.
execute_playwright_codegains an optionalexecutorparameter (^[A-Za-z0-9_-]{1,64}$), passed to the SDK only when set. Omitting it (or passingdefault) keeps today's behavior:pageis bound to the active tab. Any other name runs the call in a named executor that owns its own background tab, so independent tasks can run in parallel in separate tabs of one browser while calls on the same executor stay serialized.tab(target_id,created) when the API reports the tabpagewas bound to.manage_playwright_executorstool in theplaywrighttoolset withlistanddeleteactions.deletetakesnameand an optionalclose_tab(default true); deletingdefaultrestarts it instead of removing it.tool-names.tsand the registration tests include the new tool.Dependencies
Depends on
@onkernel/sdk0.120.0 (released), which includesbrowsers.playwright.executorsand theexecutor/tabfields on execute.package.jsonis bumped to"@onkernel/sdk": "0.120.0"and the lockfile change is limited to that dependency.Tests
src/lib/mcp/tools/playwright.test.tscovers executor passthrough, name validation,tabin the result, the 409 limit error, and list/delete (defaultclose_tab, explicitclose_tab: false,defaultrestart wording, missing name, API 404).bunx tsc --noEmit --incremental false,bun test(902 pass), andbun run check:managed-auth-apppass locally.bun run format:checkreports only a pre-existing issue inAGENTS.md, which this PR does not touch.