Skip to content

fix(webmcp): send Origin-Agent-Cluster so tools can register - #7

Merged
ribdsp merged 1 commit into
mainfrom
fix/origin-agent-cluster
Aug 28, 2026
Merged

ribdsp merged 1 commit into
mainfrom
fix/origin-agent-cluster

Conversation

@ribdsp

@ribdsp ribdsp commented Aug 28, 2026

Copy link
Copy Markdown
Owner

What was wrong

Production at traces.ribdsp.com served only Origin-Trial. Verified from outside:

$ curl -sI https://traces.ribdsp.com | grep -i origin-
Origin-Trial: Ap5I3ve...   (origin traces.ribdsp.com:443, isSubdomain, expiry 2026-11-17)

No Origin-Agent-Cluster. git grep found the header nowhere in the repo.

WebMCP will not accept a tool unless the document is origin-isolated, and that is a
separate requirement from the origin trial. Having one without the other produced the
worst failure the app can produce:

  • document.modelContext exists, so registerTools reports native
  • all sixteen registerTool calls throw
  • the catch at register-tools.ts:69 — correctly written so one bad schema cannot
    cost the other fifteen tools — turns sixteen failures into sixteen console.warn
    lines and an empty registered array
  • ToolStatusBanner renders the green branch: WebMCP live · 0 tools

A live URL, a green status line, and nothing on the page an agent can call.

The change

headers() now sends Origin-Agent-Cluster: ?1 whether or not a token is configured,
because isolation is not part of the trial. There is no longer a path that returns no
headers at all.

Test plan

  • npm run build green
  • Both headers baked into .next/routes-manifest.json, in order:
    [{Origin-Agent-Cluster ?1}, {Origin-Trial ...}]
  • Token-less branch still emits isolation: [{Origin-Agent-Cluster ?1}] — so
    npm run dev without .env.local is origin-isolated too
  • After deploy: curl -sI https://traces.ribdsp.com shows both headers
  • After deploy: banner reads 16 tools, and the sixteen
    [traces] host rejected tool ... console warnings are gone

Note for whoever picks this up next

This fixes the cause but not the blind spot. native with
registered.length === 0 still renders the green branch in
tool-status-banner.tsx:132, which is the exact scenario that component's own
docstring says it exists to prevent. That case deserves to be as loud as
unavailable. Left alone here — different area, and it wants its own decision.

The document has to be origin-isolated before WebMCP will accept a tool, and
that is a separate requirement from the origin trial. Production had only
`Origin-Trial`, which produced the worst failure available: `document
.modelContext` existed, so the banner reported `native` in green, while all
sixteen `registerTool` calls threw and `registerTools` returned an empty
array. Live URL, green status line, `0 tools`, nothing agent-callable.

The header now ships whether or not a token is configured, since isolation
is not part of the trial — `headers()` no longer has a path that returns
nothing.
@vercel

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
traces Building Building Preview Aug 28, 2026 2:03pm

@ribdsp
ribdsp merged commit 8d255a2 into main Aug 28, 2026
5 checks passed
@ribdsp
ribdsp deleted the fix/origin-agent-cluster branch August 28, 2026 14:05

This branch was successfully deployed

1 active deployment
Preview — 55f95283 Deployed Aug 28, 2026 by vercel[bot]
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.

1 participant