| Commit-Queue | +1 |
inline constexpr char kWebMCPTestingName[] = "WebMCP for testing";Dominic FarolinoCan we keep the name "WebMCP for testing"? See https://www.google.com/search?q=%22WebMCP+for+testing%22 for instance
Hmm, I'd prefer not to, but it can't hurt to keep the name the same, so that sounds fine.
ExecutionContext* GetExecutionContext() const override;Dominic FarolinoCan we remove this? I believe it was used only for `ModelContextTesting::GetExecutionContext()`
No, `EventTarget` lists this method as a pure virtual function.
#include "base/functional/callback_forward.h"Dominic FarolinoDo we still need this?
Negative. Nice catch!
RuntimeEnabled=WebMCPTestingDominic FarolinoThe blink runtime feature `WebMCPTesting` needs to be removed as well. Note that you'll need to update https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/about_flags.cc;l=12539;drc=b49ce6f9adf6e7151b06168880212578150f57e4 as well to switch to `blink::features::kWebMCP`. The flag name needs to stay the same.
Why does the name need to stay the same? To stay consistent with published developer documentation or something? Anyways, I've done this so I think we're clear!
name: "WebMCPTesting",Dominic FarolinoIf we're removing this feature, it means we'll have to update [Puppeteer](https://pptr.dev/guides/webmcp), [Chrome DevTools for Agent](https://github.com/ChromeDevTools/chrome-devtools-mcp), and maybe more documentation. Is there a way somehow to keep this functional?
I can hold off on removing it for now, but we should remove it soon. Can you kick off the process of changing whatever you'd want to change for us to be able to remove this? I'll try and remember to remove it in the next milestone.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
name: "WebMCPTesting",Dominic FarolinoIf we're removing this feature, it means we'll have to update [Puppeteer](https://pptr.dev/guides/webmcp), [Chrome DevTools for Agent](https://github.com/ChromeDevTools/chrome-devtools-mcp), and maybe more documentation. Is there a way somehow to keep this functional?
I can hold off on removing it for now, but we should remove it soon. Can you kick off the process of changing whatever you'd want to change for us to be able to remove this? I'll try and remember to remove it in the next milestone.
I'll start this process. Thanks!
<title>WebMCP: Filling custom element</title>I don't think this should be moved to external since `toolFillCallback` is not spec'ed and still highly experimental
await waitForTool('fill_text');How about we update `waitForTool` to return the Tool from getTools so that we don't have to run `document.modelContext.getTools` again?
document.modelContext.registerTool({Shall we add `await` now before `registerTool()`?
const tool = await getTool("failing_js_tool");This is not valid.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
I don't think this should be moved to external since `toolFillCallback` is not spec'ed and still highly experimental
Done
How about we update `waitForTool` to return the Tool from getTools so that we don't have to run `document.modelContext.getTools` again?
Nice. Done.
Shall we add `await` now before `registerTool()`?
Not before https://crrev.com/c/7916507 has landed, right?
const tool = await getTool("failing_js_tool");This is not valid.
Can you clarify what isn't valid? Is this helper incorrect, or something else?
output : {Is this change expected?
Unfortunately yes. ModelContextTesting supports tool cancellation via AbortSignal [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/script_tools/model_context.cc;l=629-631;drc=13c5969778bff936fb3991389511f695fd2e0319), which previously let us surface `status: Canceled` here. But the ordinary web platform API doesn't yet support cancellation through signal (see http://b/481899636), which means `ScriptToolErrorCode::kToolCancelled` is never communicated, which means the inspector never [hits this path](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_web_mcp_agent.cc;l=230-232;drc=6ce6f0f91493b5c3a3ce713a2ef454db5deb45a3).
So this expectation reflects the migration to the normal web platform API which doesn't really support tool execution cancellation, and this expectation will be reverted once we fix the above bug.
Does this make sense?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
document.modelContext.registerTool({Dominic FarolinoShall we add `await` now before `registerTool()`?
Not before https://crrev.com/c/7916507 has landed, right?
I thought we could add `await` since it's spec compliant AND it works now, even without the implementation. If not, I'll have to update those tests when adding promise support to registerTool
const tool = await getTool("failing_js_tool");Dominic FarolinoThis is not valid.
Can you clarify what isn't valid? Is this helper incorrect, or something else?
I got confused by the tool name. Sorry for the noise.
description : Error: JS Error at failing_js (<anonymous>:33:48) at window.executeFailingJS (<anonymous>:79:49) at <anonymous>:1:8Do you know what caused this line change?
output : {Dominic FarolinoIs this change expected?
Unfortunately yes. ModelContextTesting supports tool cancellation via AbortSignal [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/script_tools/model_context.cc;l=629-631;drc=13c5969778bff936fb3991389511f695fd2e0319), which previously let us surface `status: Canceled` here. But the ordinary web platform API doesn't yet support cancellation through signal (see http://b/481899636), which means `ScriptToolErrorCode::kToolCancelled` is never communicated, which means the inspector never [hits this path](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_web_mcp_agent.cc;l=230-232;drc=6ce6f0f91493b5c3a3ce713a2ef454db5deb45a3).
So this expectation reflects the migration to the normal web platform API which doesn't really support tool execution cancellation, and this expectation will be reverted once we fix the above bug.
Does this make sense?
I didn't realize `modelContext.executeTool(myTool, { signal })` was not supported yet. Thanks for the details!
assert_true(!!tool, 'Tool should be registered');Why `assert_true`? `waitForTool` won't resolve if there's no tool.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
description : Error: JS Error at failing_js (<anonymous>:33:48) at window.executeFailingJS (<anonymous>:79:49) at <anonymous>:1:8Do you know what caused this line change?
Yeah, with `ModelContextTesting`, `executeTool()` invoked the local tool synchronously inside `window.executeFailingJS()`. So the call stack included at window.executeFailingJS. With document.modelContext, execution happens asynchronously over Mojo, so `failing_js()` executes outside of the synchronous `executeFailingJS()` calling function. So `window.executeFailingJS` is naturally absent from the stack trace. Does that make sense?
I'll resolve this for now since I think this answers it, and we can land this. But if you want more clarity lmk!
Why `assert_true`? `waitForTool` won't resolve if there's no tool.
True, removed!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
Alex, could you look at `model_context_user_data.cc`? The change there is pretty small.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Alex, could you look at `model_context_user_data.cc`? The change there is pretty small.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/60698.
When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.
WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
WebMCP: Remove the ModelContextTesting API
R=beaufort...@gmail.com
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/60698
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |