Persistent tools via workers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 領域
- web-dev
調査の方向性
Start with this issue’s linked WebMCP Permissions Policy documentation and the related discussions in issues #199 and #167. Map persistent execution, registration, and headless service-worker tools against the permission and navigation constraints described. Done means the scope is agreed and a concrete worker-based API design answers how pending tool calls survive document navigation and reconnect to an agent.
索引モデルが issue の本文から書いたものです。
説明
This has been raised a few times in side discussions, but the notion of running tools in workers to support tool execution that survives document navigations deserves its own dedicated issue.
I think WebMCP + workers means a few things, and solves a few different problems, so I'll try and enumerate all of the motivations below so we can see what's in scope and what's not.
1. Persistent tool execution
WebMCP tool execution is tied to a document, so if a tool does a bunch of work but the page navigates away (could be the agent, could be the tool itself), execution is basically lost and has to start over on the next page. By then, it might not be able to give a response back to the agent, since the new document is kind of "starting over", and doesn't know about the pending execution that just died.
In https://github.com/webmachinelearning/translation-api/issues/18, other folks in the agentic space lay out a partial motivation that also applies to WebMCP:
The Motivation: The "Navigation Tax" on MPAs
AI tasks tend to be uniquely heavy, expensive, and long-running. In an MPA, every link click is a "hard reset" that destroys the current document context, and everything that goes with it, AI tasks included...
If we don't provide a way to maintain an active task across a same-site navigation, MPA developers are forced into a corner: either waste compute by restarting tasks on every page load and hoping it finishes in time, or force a shift to Single-Page Application (SPA) architectures just to make AI UX more viable. Finding a platform-level solution to keep these tasks alive safely seems critical for web-wide adoption of AI.
For WebMCP, we basically substitute "AI tasks" with "Tool execution invoked by AI". You can easily move the meat of "heavy" tools over to workers by making your WebMCP tool a thin wrapper around code that just postMessage()s a worker. But the real problem is when the document hosting the actual tool navigates and the next document connects with the worker to pick up its "tool result", the new document has no way of sending this back to the agent, to "resume" now-dead tool call.
We can solve this by creating some API that lets new documents "re-connect" to pending agent tool calls, and provide responses to them. Or we can solve this by allowing workers to run tools that execute beyond a document's lifetime.
Note that the Writing Assistance APIs have avoided this so far. Since Permissions Policy isn't spec'd for workers, APIs that rely on it basically don't work there, and WebMCP is one of these APIs along with Writing Assistance. So to support tool execution in interesting contexts like shared and service workers, we need some solution to this. I've discussed potential designs for this with @zcorpan and others, but we need to hash something concrete out.
/cc @kenjibaheux and @michaelwasserman
2. Persistent tool registration
In addition to tool execution beyond a document's lifetime, worker integration provides tool registration beyond a document's lifetime. This has been discussed in point (4) of #199 (and to a lesser extent #167, which is also aimed at reducing tool registration thrashing).
Built-in agents see a whole tab, and struggle[^1] to understand why tools would go in and out of context so much while moving through a site. By allowing workers to register tools, we let tool declarations survive beyond a document's lifetime, which reduces tool churn. However, as discussed in https://www.w3.org/2026/06/25-webmachinelearning-minutes.html#10003 it's not clear how bad the "tool churn" problem really is. From our experience, built-in agents have a "pull" relationship with tools, not a "push" one, so we probably need to hear more from built-in agent developers (or even framework experts like @sdras, who raised this in #199) about how bad this problem is and how much persistent registration would buy us.
/cc @khushalsagar for any insight about Gemini-in-Chrome, and @bwalderman and @victorhuangwq for Copilot-in-Edge.
3. "Headless" tools
Related to the above: if we supported service worker tools, this unlocks use cases where a built-in agent can run tools on sites with service workers in a "headless" fashion. Example: you ask your built-in browser agent to go to your calendar and find tomorrow's meeting, and send the zoom link to Bob. If calendar.google.com and gmail.com had service workers with get_event_details() and send_email() tools respectively, the agent wouldn't need to physically open tabs and render site UI to accomplish this task.
This is really straddling the line between the fully headless MCP world, and the very not-headless co-browsing UI case that WebMCP was designed for. It's in the middle because it's headless-but-still-web, and not server-side MCP. It's unclear what the market appetite is. For example, sites might ask "why would I implement headless service worker tools when I already have an MCP server that the agent can reach out to??"
With all of that said, how do people feel about the motivations/problem enumeration above, and the value that worker integration provides?
[^1]: I only have Google-internal evidence to cite, where we had to be extra careful when prompting the model to help it understand that tools are dynamic, and can disappear for any reason. Further, we told it that tools are not "site-global" but rather "page-bound", which contributes to how often they leave and come back into view.
- 主要言語
- Bikeshed
- スター
- 4.7k
- フォーク
- 328
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 15
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
webmachinelearning/webmcp のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
webmachinelearning/webmcp#362 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
webmachinelearning/webmcp#360 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Say how an agent should weigh annotations that the page wrote about itself対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
webmachinelearning/webmcp#353 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
webmachinelearning/webmcp#343 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Agenda+ i18n-tracker
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
webmachinelearning/webmcp#273 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
webmachinelearning/webmcp の issue をすべて見る
似ている issue
-
area/sessions comp/desktop desktop/sessions P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NousResearch/hermes-agent#145383 ·
メンテナーはふだん 1 日以内に返信
-
eve/client: optimistic send crashes on non-secure origins when crypto.randomUUID is unavailable対応中かも @roboeve が今日担当しました。 オープンbug client p1
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug from-studio
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
esengine/DeepSeek-Reasonix#14608 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
atomityhq/blog-cms#82 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getarcaneapp/arcane#4590 ·
メンテナーはふだん 1 日以内に返信