Repository navigation
feat(browser): call WebMCP page tools before clicking (LAC-6315) - #923
Draft
lacymorrow wants to merge 1 commit into
Draft
lacymorrow wants to merge 1 commit into
lacymorrow wants to merge 1 commit into
Conversation
…Context) Adds browser_list_page_tools and browser_call_page_tool, a page-tools hint on browser_navigate, risk from the page's consequentialHint, untrusted wrapping for untrustedContentHint, and --enable-features=WebMCP on Juno-launched Chrome. LAC-6315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paperclip: LAC-6315
When a page publishes WebMCP tools, Juno's browser agent now calls them. The DOM path (
browser_interact) stays as the fallback.What changed
browser_navigateappendspage_tools(names plus short descriptions) to its result when the page has tools. Nothing is added when it has none.browser_list_page_tools: full list with input schemas and the page's annotations. Empty list, never an error, when there is no API.browser_call_page_tool(name, input, timeout?): looks the tool up ingetTools()(executeTooltakes the tool object, not a name), runs it with anAbortSignaland a 30 s default timeout.risk_classifierandpermission_policy):consequentialHintis High, so it asks in "Ask me first" and "Ask when risky".readOnlyHintwithout consequential is Low.webmcp.rskeeps a small registry refreshed on every listing. If a consequential tool was not approved as consequential (stale registry), the call is refused and the model re-lists, so the gate asks next time.untrustedContentHintoutput is wrapped as{untrusted_content: true, source, warning, content}.--enable-features=WebMCP.Spike (Chrome 156.0.8078.74)
document.modelContextisundefinedwith no flags and an object with--enable-features=WebMCP, headless and headed, on a secure context (localhost). Full table in the issue thread. Consequence: a Chrome the person started themselves, without the flag, shows no API, and Juno silently uses the DOM.Cut
navigator.modelContextfallback (removed in Chrome 152).Test plan
webmcp.rs(parsing, hint cap, untrusted wrapper, risk registry, JS literal embedding). CI.risk_classifierdrift tests cover both new tools (list is deliberately ungated, call has its own arm).webmcp_page_tools_are_listed_and_called_without_clickingintests/browser_cdp_live.rs(#[ignore], Chrome on :9222 started with--enable-features=WebMCP).Not done yet
Recording of Juno finishing a task on the fixture page by tool call. It needs this branch built by CI and an attended run. Will be committed to
docs/changelog/media/<PR>/.