Skip to content

Match WebMCP shape where executeTools takes an object - #19

Merged
igrigorik merged 8 commits into
igrigorik:mainfrom
yoavweiss:webmcp-object-arguments
Oct 17, 2026
Merged

igrigorik merged 8 commits into
igrigorik:mainfrom
yoavweiss:webmcp-object-arguments

Conversation

@yoavweiss

Copy link
Copy Markdown
Contributor

Chrome 155 added a breaking change to executeTools()'s input schema.

This PR adapts AgentBoard and its polyfill to that change.

yoavweiss and others added 5 commits October 15, 2026 09:36
Chromium (M155 and M156 respectively) added two members to the ToolAnnotations
dictionary. Dictionary conversion means every member reads back as false once
annotations are present, so getTools() descriptors from the polyfill were
missing keys that WPT getTools-imperative-annotations now asserts at the
revision this branch pins.
…Context

Chromium moved toolactivated and toolcancel from window to document.modelContext
as ToolActivatedEvent/ToolCancelEvent instances (M156) and removed the window
dispatch; WPT executeTool-abort at the pinned revision asserts the new target,
the interface brand and event.target identity, and timed out against the
polyfill's window-targeted plain Events.

The local backend now fires the two interfaces at itself and the facade
re-dispatches fresh instances so page code observes document.modelContext as
the target, the same way toolchange was already forwarded. ontoolactivated and
ontoolcancel join ontoolchange; the three handler attributes share one Web IDL
style definition instead of a hand-written accessor pair per class.
The bridge now sends executeTool() an object, which Chromium before M155
(DOMString inputArguments) cannot parse, so keeping the lifecycle's parse of
string inputSchema values only let a catalog load whose every call would fail.
Native and polyfill both expose inputSchema as an object; pass it through.

M154 left stable on 2026-10-06 and the WebMCP origin trial runs on 155+, so no
supported configuration still speaks the string shape.
tests/browser/webmcp-wpt.mjs already pins a WPT revision and runs the built
polyfill against it with native WebMCP disabled, but only by hand. This branch
bumped that pin and would have merged with two files red had the harness not
been run manually, so it now runs on the 24.x leg next to the other browser
tests. Chrome's wpt product needs no hosts-file changes, so no sudo is required.
A fresh `git clone --no-checkout --sparse` reports every tracked file in WPT
as deleted, so `git status --porcelain` produced 12 MB of output and spawnSync
failed with ENOBUFS at its 1 MB buffer. That path never ran on a machine that
already had local/wpt, and CI is the first fresh clone. The guard exists to
protect modifications in an existing checkout, so it now runs only there.
…thon < 3.12.7

argparse before 3.12.7 matches a trailing nargs='*' positional as empty when
options separate it from the preceding positional, so `wpt run chrome
--yes ... test.html` reported every test path as an unrecognized argument.
Stock python3 on Ubuntu 24.04 (the CI runner) is 3.12.3; local runs on newer
interpreters never hit it. Options now come first and `chrome` is followed
directly by the tests, which parses on every version.

Reproduced and verified with a fresh clone and a 3.12.3 venv: the old order
fails, the new order runs 19/19 files.
…s are built

wpt run defaults to every test type, and the presence of aamtest makes it
install requirements_platform_accessibility.txt: on Linux that is PyGObject,
which builds pycairo from source and fails on CI without cairo headers. On
macOS the same file resolves to pyobjc wheels, so local runs never noticed.
The canonical WebMCP files are testharness tests plus one crashtest; naming
those two types skips the file entirely instead of adding system packages.

Verified with a fresh clone and a Python 3.12.3 venv: no accessibility
packages installed, 19/19 files and 39/39 subtests pass.
@igrigorik
igrigorik merged commit fa0ff10 into igrigorik:main Oct 17, 2026
2 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.

2 participants