AIGenLab
EN

UPDATEcopilotkit v1.91.0

CopilotKit v1.91.0 opens frontend tools to browser agents

Version & typev1.91.0 · Feature
In short

CopilotKit v1.91.0 adds an opt-in WebMCP switch that exposes every frontend tool at once, passes after, before and limit through to thread messages, and fixes Node 22 reconnects plus tool-result metadata that a snapshot used to drop.

What changed in this release

26 checkpoints in 5 groups, organized by task from the official notes. Checkpoints do not count separate features or commits.

Whole-page WebMCP exposure

  • defaultWebMCPTools registers all frontend tools with a handler and a description.
  • It is off by default, so behaviour is unchanged unless you open it.
  • A tool with webmcp: false stays private; the switch does not override it.
  • Human-in-the-loop, render-only and built-in generateSandboxedUi tools stay out.
  • React, Vue and Angular all take the setting, each starting and stopping registration at its own unmount point.

Registration lifecycle

  • The core gains startWebMCP(), stopWebMCP() and a deferWebMCP option.
  • React registers in a commit phase, so a discarded render registers nothing.
  • Vue stops in onBeforeUnmount, letting a keyed replacement reuse the names.
  • Angular stops when the injector owning the service is destroyed.
  • On collision a tool that sets webmcp wins, otherwise the first one does.

Thread message paging

  • after=<messageId> returns only messages after that one.
  • before=<messageId> pages backwards through older messages.
  • limit=<n> caps the count, and the platform caps a page at 1000.
  • Replies add two fields, before and page, and page holds hasOlder, olderThan and truncated.
  • after and before take non-empty strings of at most 256 characters.
  • limit takes a positive whole number, so 0, -1, 1.5, abc and 1e3 are ignored.
  • A local runner without Intelligence ignores all three and returns everything.

Stream reconnects

  • On Node 22 a handshake answered 502, 503, 504 or 401 now arms the timer.
  • When it fires with the socket still down, the runner cycles it as after a close.
  • A connected run keeps its two attempts at 0.1 and 2.5 seconds.
  • No new option, back-off or log line is added.
  • Node 24, Node 26 and Bun behave as before.

Tool-result metadata

  • A rebuilt tool result now copies the event metadata instead of dropping it.
  • A promoted placeholder merges the event metadata with mergeMetadata.
  • Results without metadata get no empty key.
  • LangGraph artifacts land once the upstream change ships and @ag-ui/langgraph is bumped.

Read the original announcement

On this page
  1. Release inventory
  2. The three things this rel…
  3. One switch turns every ha…
  4. Registrations follow the…
  5. Thread messages page with…
  6. A refused handshake now r…
  7. Tool-result metadata surv…
  8. The same step sits in thr…
  9. v1.90.2 only bumped packa…
  10. Release analysis
  11. Questions
  12. Sources & method

ContextThe three things this release touches are the ones already in your way

Three things are in your way on CopilotKit: a browser agent cannot see the page's tools, reopening a thread re-reads it whole, and on Node 22 a dropped stream leaves a run running.

WebMCP lets a browser agent discover and call tools that stay on the page. Before, only tools that set webmcp were registered; defaultWebMCPTools takes every tool with a handler and a description.

Two fixes as well: the runtime used to drop every parameter except userId and now sends after, before and limit, and tool results keep their TOOL_CALL_RESULT metadata when a snapshot rebuilds them.

The changes fall into five groups: whole-page exposure, registration lifecycle, thread paging, stream reconnects and tool-result metadata. The chart below lays them out.

The release spreads across five groups: whole-page exposure, registration lifecycle, thread paging, stream reconnects and tool-result metadata, with the first two forming the WebMCP exposure named in the announcement. The chart shows the distribution by inventory group.
Where the 26 grouped changes landWhere the 26 grouped changes landWhole-page WebMCP exposure5Registration lifecycle5Thread message paging7Stream reconnects5Tool-result metadata4
AIGenLab original

One switch turns every handler-backed frontend tool on the page into a WebMCP tool

  1. Whole-page switch: defaultWebMCPTools registers every frontend tool with a handler and a description, off by default.
  2. Exceptions: webmcp: false keeps a tool private, human-in-the-loop and render-only tools are skipped, and generateSandboxedUi sets it too.
  3. Cost first: WebMCP is page-level, so any aware browser agent can call these tools; check authorization in every handler.

Registrations follow the component, so an unmount or a replaced provider takes the tools off the page

  1. New API: the core gains startWebMCP(), stopWebMCP() and deferWebMCP, so registration starts and stops explicitly.
  2. Unmount stops registration: React stops on unmount, Vue in onBeforeUnmount so a keyed swap reuses names, Angular when its injector is destroyed.
  3. Name collisions: a tool that sets webmcp itself beats one that only follows the switch; otherwise the first wins.

Thread messages page with after, before and limit, so reopening an old thread stops re-reading it whole

  1. Passed through: the runtime kept only userId and now sends after, before and limit; the platform caps a page at 1000 messages.
  2. Validation: after and before must be non-empty and at most 256 characters; limit must be a positive whole number, or it is dropped.
  3. Boundary: replies gain only before and page, and a local runner without Intelligence returns the full transcript with no paging fields.

A refused handshake now reconnects on Node 22, so a dropped run stops sitting there as running

  1. What was missing: on Node 22 the built-in WebSocket raises only error, not close, when a 502, 503, 504 or 401 answers the handshake.
  2. The fix: the runner arms the same reconnect timer from error and cycles the socket, with no new option or log line.
  3. Unchanged: Node 22 still retries a connected run at 0.1s and 2.5s, then fails on the existing timeout; Node 24, Node 26 and Bun keep retrying.

Tool-result metadata survives snapshot reconciliation, which gives LangGraph artifacts a place to land

  1. Restoring: when a snapshot dropped a tool result, the rebuilt message now copies the metadata from the TOOL_CALL_RESULT event.
  2. Promoting: a placeholder promoted to a real result merges the event metadata with mergeMetadata, the merge @ag-ui/client uses.
  3. Boundary: results without metadata get no empty key, and the LangGraph artifact waits on an upstream release and a bump.

The same step sits in three layers: CopilotKit registers, AI SDK reads, LangGraph keeps tools on the server

The job is the same - let an agent use page and thread state - but each vendor puts it elsewhere. AI SDK reads page tools, LangGraph streams server calls, CopilotKit fills in registration.

Read the table by column, not by counting cells: a full cell is not a score. Paging is easiest to misread, since AI SDK reads app storage, LangGraph checkpoints, CopilotKit platform messages.

Bottom line: if all page tools must reach a browser agent, CopilotKit's switch is shortest; if a page already exposes WebMCP tools, AI SDK's transport is more direct.

Update pointVercel AI SDK ai@7.0.188LangGraph JS SDK 1.17.0CopilotKit v1.91.0
Frontend tools exposed to browser agentsAn experimental WebMCP transport reads document.modelContext, and the list is a snapshotTools live on the server graph, and the browser gets calls via thread.toolCallsdefaultWebMCPTools registers every handler-backed tool on the page, off by default
Registration lifecycleClosing the client aborts pending calls without unregistering page toolsclose() tears down subscriptions and the shared SSE or WebSocket linkstartWebMCP() and stopWebMCP(), stopping on React unmount, Vue onBeforeUnmount and Angular destroy
Thread message pagingMessages load from app storage, then go through validateUIMessagesgetHistory pages back through checkpoints with limit and beforeThe runtime forwards after, before and limit, and replies carry page, hasOlder and olderThan
Stream reconnectsuseChat with resume reconnects on mount and on visibilityThe SDK handles reconnects, replay and dedup, and the server replays buffered eventsA refused handshake on Node 22 arms the reconnect timer and cycles the socket
Tool-result metadataMetadata rides out via messageMetadata and reads as message.metadataEach history entry is a ThreadState carrying metadataSnapshot restores and promotions keep the TOOL_CALL_RESULT metadata

v1.90.2 only bumped package versions, and these five capabilities arrive in v1.91.0

The previous release added no behaviour, so each row is a capability that first appears here. Left is v1.90.2 from 2026-11-23; right is v1.91.0 from 2026-12-01.

The rows split in two: three had no switch or parameter at all, and two are places where information used to be lost. Schedule the first three as new work and treat the last two as long-standing gaps to close, because the two kinds are accepted differently.

The table doubles as an acceptance list: call a tool and see it registered, unmount and see it gone, page a thread and look for page, restart on Node 22 and watch the run recover.

Capabilityv1.90.2v1.91.0
Whole-page exposureOnly tools that set webmcp were registereddefaultWebMCPTools registers every tool with a handler and a description
Registration lifecyclewebmcp: true registrations stayed after the provider unmountedstartWebMCP() and stopWebMCP(), stopping at each framework's unmount point
Thread message readsThe runtime dropped every parameter except userId, so a thread was read wholeafter, before and limit pass through, and a page caps at 1000 messages
Node 22 streamsAfter a refused handshake the runner tried once and reported nothingThe reconnect timer also arms from error and cycles the socket
Tool-result metadataRebuilding a result from a snapshot lost the TOOL_CALL_RESULT metadataRestores copy the metadata and promotions merge it with mergeMetadata

Release analysisTeams handing frontend tools to browser agents should upgrade, and local-only demos can wait

Two groups should move first: teams that already let a browser agent call page tools, and teams that re-read a transcript whenever someone reopens a chat. For them this removes handwork; local-runner teams can stay put.

Teams on Node 22 with one socket per run should upgrade for the reconnect timer alone. The old behaviour left a run as running with no event and no error, so whoever was on call had nothing to check. Station view, not independently tested: Node 24, Node 26 and Bun see no change here, so no separate window is needed for them.

Across vendors the difference is placement. AI SDK consumes tools a page registered and treats the list as a snapshot; LangGraph pages history and keeps reconnects and dedup in the stream; CopilotKit brings the switch, the override and cleanup.

Our advice, as a station view rather than a measured result: turn the switch on in a preview build, call two or three critical tools from a WebMCP-aware agent, confirm each handler checks authorization, then ship. On the thread side, wire after first and keep before for paging backwards. Where the runtime is on Node 22 and runs sit in running, upgrade before you investigate, because the old behaviour left no error to look at.

AIGenLab views

Not independently tested

Turn on defaultWebMCPTools in a preview build, call two or three critical tools from a WebMCP-aware browser agent, confirm each handler checks authorization, and only then ship it.

Station view, not independently tested: based on the inclusion conditions, excluded tool types and page-level authorization warning listed in PR #8577.

Apps that reopen old threads should wire after first instead of pulling the whole transcript, and keep before for scrolling back.

Station view, not independently tested: based on the whole-transcript re-read described in PR #8609 and the rules it gives for the three parameters.

Teams already on Node 24, Node 26 or Bun do not need a separate upgrade window for this reconnect change.

Station view, not independently tested: based on PR #8574 recording that these runtimes kept retrying on 1.90.2.

Questions

Does turning on defaultWebMCPTools expose human-in-the-loop tools as well?
No. The switch only takes tools with both a handler and a description; a human-in-the-loop handler waits for a person in the chat UI that a browser agent never sees, so those tools are excluded, and render-only tools and the built-in generateSandboxedUi are out too. To keep one tool private, set webmcp: false on it, which wins over the switch.
Why do the paging parameters do nothing on a local runner?
after, before and limit are query parameters the runtime hands to the Intelligence platform. A local runner has no platform to ask, so it ignores all three, returns the full transcript and adds no before or page field. Paging needs a runtime connected to Intelligence; validation still applies, so an invalid value is never sent.
My runtime already runs on Node 24, so what does the reconnect change require?
Nothing on its own. The fix targets Node 22, where the built-in WebSocket raises only error and not close; Node 24, Node 26 and Bun already kept retrying and recovered, so their behaviour is unchanged. There is no new option, back-off or log line either, so no runtime setting changes after the upgrade.

Official sources and scope

Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.