Skip to content

fix: move docs and examples off the v1 runtime entrypoint - #6617

Merged
MikeRyanDev merged 8 commits into
mainfrom
ben1/v2-runtime-migration
Aug 21, 2026
Merged

MikeRyanDev merged 8 commits into
mainfrom
ben1/v2-runtime-migration

Conversation

@BenTaylorDev

@BenTaylorDev BenTaylorDev commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Moves docs and examples off the deprecated v1 runtime entrypoint, so a reader who follows a quickstart ends up with a runtime that can actually be probed (GET /api/copilotkit/info).

Stage 0 proves the target shape in a real running app; Stage 1 propagates that proven code into the docs. 50 files. No file owned by #6517 or #6582 is touched (verified against the full ownership list). Stacks cleanly with #6618, which does the same for showcase/integrations/**.

Stage 0 — examples/shadcn, proven live

A textbook instance of the reported bug: a v1, POST-only route behind a @copilotkit/react-core/v2 frontend.

Before After
GET /api/copilotkit 405 Method Not Allowed 404 (correct: multi-route serves nothing at the bare basePath)
GET /api/copilotkit/info 404 — Next.js HTML 404, the path did not route at all 200
POST /api/copilotkit/agent/default/run n/a 200, chat turn renders in the UI

Exact GET /api/copilotkit/info body from the running app:

{
  "version": "1.61.2",
  "agents": {
    "default": {
      "name": "default",
      "description": "",
      "className": "BuiltInAgent",
      "capabilities": {
        "tools": { "supported": true, "clientProvided": true },
        "transport": { "streaming": true },
        "humanInTheLoop": { "interrupts": true }
      }
    }
  },
  "audioFileTranscriptionEnabled": false,
  "mode": "sse",
  "threadEndpoints": { "list": true, "inspect": true, "mutations": false, "realtimeMetadata": false },
  "a2uiEnabled": false,
  "openGenerativeUIEnabled": false,
  "telemetryDisabled": false
}

(Captured before the @copilotkit/* bump in the same commit, hence 1.61.2.) The model backend was aimock — @copilotkit/aimock 1.37.4, the same mock the test / integration / docs CI job uses — so the chat turn is real traffic through the migrated route with no live API key.

Three findings that changed the shape of this work

All three came from running the code rather than reading it, and all three affect every page Stage 1 touches.

1. The plan's canonical shape was deprecated, and that is where hono came from

The prescribed snippet was createCopilotEndpoint + handle from hono/vercel. createCopilotEndpoint is a deprecated alias — this repo's own handler table in docs/backend/runtime-endpoints.mdx lists it under "Deprecated → use createCopilotHonoHandler".

createCopilotRuntimeHandler serves the same multi-route mode (it is the default), returns a plain fetch handler, is not deprecated, and needs no hono at all:

const handler = createCopilotRuntimeHandler({
  runtime,
  basePath: "/api/copilotkit",
});

export const GET = handler;
export const POST = handler;

I first propagated the deprecated shape and then documented installing hono to make hono/vercel resolve under pnpm. Both are reverted in 720910833e: hono was an artifact of the shape, not a requirement of the library. Verified by deleting node_modules/hono outright, not merely removing it from package.json, so a hoisted copy could not mask the result — GET /info → 200, POST /agent/default/run → 200, turn renders. No sidecar lists hono any more, so CI proves by construction that these snippets do not need it.

2. The multi-route runtime needs a frontend co-change, and the docs said otherwise

Published <CopilotKit> still ships

useSingleEndpoint={props.useSingleEndpoint ?? true}

(verified in the @copilotkit/react-core 1.68.3 bundle), pinning the single-route transport. A multi-route runtime answers that envelope with 404 while GET /info still returns 200, so the app looks connected. The runtime diagnoses it itself:

Received a single-route request envelope ({ method: "..." }) but this runtime is mounted in multi-route mode, so the request matched no route. If the frontend uses <CopilotKit> from @copilotkit/react-core/v2, pass useSingleEndpoint={false} — that provider defaults it to true.

backend/runtime-endpoints.mdx — the authoritative page — said the opposite: that omitting the prop is safe on either provider because the client negotiates. True on main (#6605 removed the pin, merged today, unreleased) and false in every published release. auth.mdx, custom-agent.mdx and two quickstart callouts repeated it. All corrected: the pairing table now splits <CopilotKit> from <CopilotKitProvider> and says passing {false} is the forward-compatible choice — required now, harmless later. This is a live docs defect independent of the migration.

So the v2 multi-route shape is not a drop-in for a v1 route: changing only the route file converts a working POST-only app into a broken one.

3. showcase/shell's @ts-ignore is stale

Its canonical route carries // @ts-ignore — BuiltInAgent type mismatch with AbstractAgent, pending upstream fix. tsc --noEmit passes without it on 1.68.3, so the docs snippets carry no suppression.

Angular needs none of this: provideCopilotKit defaults its transport to "auto". Those snippets are unchanged.

The docs snippets now have a real CI gate

The plan assumed there is no automated gate on .mdx snippets. There are two, and both mattered:

  • showcase/scripts/verify-shell-docs.ts asserts the content of titled fences, and for the two Claude SDK quickstarts it requires ExperimentalEmptyAdapter and copilotRuntimeNextJSAppRouterEndpoint — actively pinning those pages to v1.
  • scripts/doc-tests/{extract,run}.ts runs in CI (test / integration / docs): a fence tagged doctest="component" is extracted and typechecked with tsc --noEmit against real npm-installed deps. Exactly one fence in the whole docs tree opted in.

20 route snippets across 20 pages are now tagged doctest="component" and typechecked in CI against real npm-installed packages. I had claimed the integration pages couldn't be doctested (path aliases, per-integration deps) — that was an assumption I never checked and it was wrong: 47 of 52 fences import nothing project-relative. Five harness defects blocked this and are fixed:

  • extract.ts wrote a fence title as a path without creating intermediate directories → ENOENT on any titled route fence.
  • run.ts derived the npm package name from the snippet directory; a catch-all leaf directory is literally [[...slug]], which npm rejects.
  • run.ts looked for doctest.json only in the snippet's own directory while the sidecar is copied per page, so a nested snippet silently installed nothing and failed with "Cannot find module".
  • extract.ts found sidecars only in a page's own directory, which would have meant ~20 duplicated dependency lists; it now walks up to the docs root, so one shared list lives at content/doctest.json.
  • run.ts installed dependencies per snippet — 7:58 for 21 snippets against a 15-minute job timeout. Each dep set now installs once into .doctest-output/.deps/<hash> and is linked in: 0:45 cold.

Mutation-checked: restoring the v1 import in a gated fence turns the run red (20 passed, 1 failed). My first attempt at this check was a silent no-op — the pattern missed because the fence is JSX-indented, and it "passed" misleadingly. The real check asserts the mutation reached the extracted snippet before trusting the result.

@ag-ui/* has to be pinned to what the runtime expects (@ag-ui/[email protected], @ag-ui/[email protected] for runtime 1.68.3). Unpinned, npm installs a newer @ag-ui/client and two AbstractAgent declarations collide: separate declarations of a private property '_debug'.

Seven fences are deliberately not gated, un-tagged with reasons rather than left red: two are illustrative fences with placeholder identifiers (myAgent, verifyJwt), and five langgraph-family fences hit that same _debug collision via @copilotkit/runtime/langgraph, which pinning does not fix. That one is a pre-existing package defect, not a migration regression — I reconstructed the v1 form of the langgraph quickstart snippet verbatim from origin/main, typechecked it against identical deps, and it fails the same way. Those snippets have never typechecked against published packages. Worth filing; it is also what the ~220 @ts-ignore comments in showcase/integrations were papering over.

A mistake worth recording

A block regex scoped to the fence's opening indentation corrupted five quickstart pages: their fences open and close at different indentation, so the match ran past the closing backticks and re-indented the following </Step> / </Tab> into the code block. Reverted and redone with a line-oriented pass that never re-indents and re-emits the closing line verbatim. (A malformed runner: insertion on three a2ui pages was caught and redone the same way.)

Every modified page is now checked structurally — fence-marker count plus every JSX structural line, indentation included, must be byte-identical to HEAD. That check found the corruption; a diff review had already missed it.

Verification

pnpm tsx scripts/doc-tests/extract.ts       -> 21 snippets
pnpm tsx scripts/doc-tests/run.ts           -> 21 passed, 0 failed (0:45 cold)
vitest extract + verify-shell-docs          -> 34 passed
showcase/shell-docs: pnpm typecheck         -> exit 0
showcase/shell-docs: pnpm lint              -> exit 0 (pre-existing warnings only)
showcase/shell-docs: pnpm build             -> exit 0
examples/shadcn: tsc --noEmit / eslint / next build -> all clean, route ƒ /api/copilotkit/[[...slug]]
structural audit                            -> every modified page, fence + JSX identical to HEAD

CI was green on the previous head (35 pass / 3 skip), including doc-tests and format.

This validates that the pages build and that the one doctested snippet compiles. It does not execute the remaining 32 fences. Their correctness rests on Stage 0: the boilerplate they now contain is the text that was run in examples/shadcn, and each page's agent wiring is untouched.

LangGraphAgent + v2 CopilotRuntime + createCopilotRuntimeHandler were typechecked together against published 1.68.3, since many pages depend on that combination.

What could not be migrated, and why

Page Why
agentic-protocols/mcp.mdx (self-hosting section) Built on createMCPClient, which exists only in v1 (packages/runtime/src/lib/runtime/copilot-runtime.ts). v2's equivalent is mcpApps; converting is a content rewrite, not a mechanical migration.
snippets/self-hosting-copilot-runtime-create-endpoint.mdx The whole page is templated on v1 service adapters ({{adapterImport}}, {{adapterSetup}}). v2 has no service adapters. Needs a rewrite of the page's premise.
Pages Router / NestJS tabs in the self-hosting-* snippets v2 exports no equivalent factory — only createCopilotRuntimeHandler and the Hono/Express/Node handlers. The App Router tab on each page is migrated.
Node HTTP / Express tabs v2 equivalents exist (createCopilotNodeHandler, createCopilotExpressHandler) but I have not run them, and the rule here was not to write a snippet I have not run.
custom-agent.mdx (both copies) Three fences each still call createCopilotEndpoint as export default copilotEndpoint — the Hono-app deployment pattern, not a Next.js route. Predates this PR; the documented replacement is createCopilotHonoHandler, which I have not run. The two copies have also drifted from each other.

Deliberate v1 prose is left alone: backend/copilot-runtime.mdx's v1→v2 mapping table and auth.mdx's note that the v1 adapter does not forward hooks are correct as written.

Other out-of-scope gaps, recorded so they can be filed

  • Mastra docs name CopilotKitIntelligence but never document constructor, project, thread, or user wiring.
  • The A2UI fixed-schema guide depends on showcase helpers not published as a package, so it cannot be followed standalone.
  • showcase/shared/starter-template is not a runnable app — no package.json, next.config, or tsconfig, so its route cannot be proved by running it. It was the plan's Stage 0 target on the grounds that "the CLI scaffolds from it"; nothing in CopilotKit packages/** or Intelligence/apps/cli/src references it, so that rationale does not hold. Its route is still v1 and still exports a hand-rolled GET that fetches the agent's /health and shadows /info. Queued behind a decision on where that status payload should live.
  • @copilotkit/cli@latest (0.0.6) has no verify command, so the runtime_reachable: pass evidence the plan asked for cannot be produced with the public CLI. The Intelligence CLI's verify is the one that probes <runtimeUrl>/info (apps/cli/src/services/verify-probes.ts), and the Stage 0 app satisfies that probe with a 200 — but the public-CLI artifact does not exist to paste.
  • Two generators still emit v1 and will re-seed the problem: showcase/scripts/create-integration/index.ts and examples/showcases/chatkit-studio/apps/playground/src/utils/codeGenerator.ts.

Corrected counts

The plan's figures were all low, partly because they matched only double-quoted imports. Measured on origin/main at 43f1ef3039:

Surface Plan said Actual
v1 code files (examples/ + showcase/, excl. examples/v1/** and _legacy/) 244 352
showcase/** importing @copilotkit/runtime 229 289
Docs files touching the v1 entrypoint 44 (37 in scope) 22 (12 in scope) — the plan counted only from "@copilotkit/runtime"; the real set is smaller but includes single-quoted and factory-only files it missed
Mixed v1-runtime + v2-frontend pages 20 26
Files already on createCopilotEndpoint 10 43 call sites

Remaining

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

All 42 services digest-pinned.

Run 2026-08-21 10:52:56 PDT — 0 finding(s).

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 1.44 MB

ℹ️ View Unchanged
Filename Size
packages/a2ui-renderer/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/a2ui-renderer/dist/a2ui-types.cjs 172 B
packages/a2ui-renderer/dist/a2ui-types.mjs 171 B
packages/a2ui-renderer/dist/index.cjs 943 B
packages/a2ui-renderer/dist/index.mjs 619 B
packages/a2ui-renderer/dist/index.umd.js 12.6 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/A2uiSurface.cjs 1.49 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/A2uiSurface.mjs 1.43 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/adapter.cjs 1.07 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/adapter.mjs 1.01 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.cjs 904 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.mjs 492 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Button.cjs 1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Button.mjs 596 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Card.cjs 829 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Card.mjs 419 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/CheckBox.cjs 1.1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/CheckBox.mjs 1.02 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChildList.cjs 799 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChildList.mjs 737 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.cjs 1.63 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.mjs 1.57 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Column.cjs 856 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Column.mjs 802 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.cjs 1.12 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.mjs 1.05 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Divider.cjs 842 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Divider.mjs 432 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Icon.cjs 877 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Icon.mjs 469 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Image.cjs 995 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Image.mjs 587 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/List.cjs 920 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/List.mjs 508 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Modal.cjs 1.19 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Modal.mjs 1.13 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Row.cjs 855 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Row.mjs 801 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Slider.cjs 1.06 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Slider.mjs 984 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Tabs.cjs 1.1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Tabs.mjs 1.04 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Text.cjs 903 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Text.mjs 489 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/TextField.cjs 1.21 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/TextField.mjs 1.14 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Video.cjs 788 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Video.mjs 378 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/index.cjs 928 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/index.mjs 855 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/utils.cjs 579 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/utils.mjs 556 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Button.cjs 982 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Button.mjs 580 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/ChildList.cjs 800 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/ChildList.mjs 735 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Column.cjs 1.08 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Column.mjs 1.02 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Row.cjs 1.07 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Row.mjs 1.01 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Text.cjs 894 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Text.mjs 839 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/TextField.cjs 1.21 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/TextField.mjs 802 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/index.cjs 849 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/index.mjs 804 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/index.cjs 310 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/index.mjs 325 B
packages/a2ui-renderer/dist/react-renderer/catalog-utils.cjs 1.59 kB
packages/a2ui-renderer/dist/react-renderer/catalog-utils.mjs 1.52 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIProvider.cjs 1.5 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIProvider.mjs 1.42 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIRenderer.cjs 728 B
packages/a2ui-renderer/dist/react-renderer/core/A2UIRenderer.mjs 671 B
packages/a2ui-renderer/dist/react-renderer/create-catalog.cjs 1.35 kB
packages/a2ui-renderer/dist/react-renderer/create-catalog.mjs 1.28 kB
packages/a2ui-renderer/dist/react-renderer/filter-catalog.cjs 622 B
packages/a2ui-renderer/dist/react-renderer/filter-catalog.mjs 569 B
packages/a2ui-renderer/dist/react-renderer/hooks/useA2UI.cjs 316 B
packages/a2ui-renderer/dist/react-renderer/hooks/useA2UI.mjs 309 B
packages/a2ui-renderer/dist/react-renderer/index.cjs 409 B
packages/a2ui-renderer/dist/react-renderer/index.mjs 568 B
packages/a2ui-renderer/dist/react-renderer/lib/utils.cjs 236 B
packages/a2ui-renderer/dist/react-renderer/lib/utils.mjs 188 B
packages/a2ui-renderer/dist/react-renderer/styles/index.cjs 239 B
packages/a2ui-renderer/dist/react-renderer/styles/index.mjs 231 B
packages/a2ui-renderer/dist/react-renderer/theme/ThemeContext.cjs 436 B
packages/a2ui-renderer/dist/react-renderer/theme/ThemeContext.mjs 381 B
packages/a2ui-renderer/dist/web-components/_virtual/_rolldown/runtime.cjs 260 B
packages/a2ui-renderer/dist/web-components/_virtual/_rolldown/runtime.mjs 258 B
packages/a2ui-renderer/dist/web-components/adapter.cjs 346 B
packages/a2ui-renderer/dist/web-components/adapter.mjs 335 B
packages/a2ui-renderer/dist/web-components/bound-component.cjs 670 B
packages/a2ui-renderer/dist/web-components/bound-component.mjs 662 B
packages/a2ui-renderer/dist/web-components/catalog/basic/audio-player.cjs 536 B
packages/a2ui-renderer/dist/web-components/catalog/basic/audio-player.mjs 492 B
packages/a2ui-renderer/dist/web-components/catalog/basic/button.cjs 647 B
packages/a2ui-renderer/dist/web-components/catalog/basic/button.mjs 604 B
packages/a2ui-renderer/dist/web-components/catalog/basic/card.cjs 448 B
packages/a2ui-renderer/dist/web-components/catalog/basic/card.mjs 402 B
packages/a2ui-renderer/dist/web-components/catalog/basic/check-box.cjs 743 B
packages/a2ui-renderer/dist/web-components/catalog/basic/check-box.mjs 695 B
packages/a2ui-renderer/dist/web-components/catalog/basic/choice-picker.cjs 1.27 kB
packages/a2ui-renderer/dist/web-components/catalog/basic/choice-picker.mjs 1.24 kB
packages/a2ui-renderer/dist/web-components/catalog/basic/column.cjs 474 B
packages/a2ui-renderer/dist/web-components/catalog/basic/column.mjs 431 B
packages/a2ui-renderer/dist/web-components/catalog/basic/components.cjs 482 B
packages/a2ui-renderer/dist/web-components/catalog/basic/components.mjs 424 B
packages/a2ui-renderer/dist/web-components/catalog/basic/date-time-input.cjs 756 B
packages/a2ui-renderer/dist/web-components/catalog/basic/date-time-input.mjs 714 B
packages/a2ui-renderer/dist/web-components/catalog/basic/divider.cjs 450 B
packages/a2ui-renderer/dist/web-components/catalog/basic/divider.mjs 404 B
packages/a2ui-renderer/dist/web-components/catalog/basic/icon.cjs 504 B
packages/a2ui-renderer/dist/web-components/catalog/basic/icon.mjs 455 B
packages/a2ui-renderer/dist/web-components/catalog/basic/ids.cjs 192 B
packages/a2ui-renderer/dist/web-components/catalog/basic/ids.mjs 190 B
packages/a2ui-renderer/dist/web-components/catalog/basic/image.cjs 624 B
packages/a2ui-renderer/dist/web-components/catalog/basic/image.mjs 578 B
packages/a2ui-renderer/dist/web-components/catalog/basic/index.cjs 465 B
packages/a2ui-renderer/dist/web-components/catalog/basic/index.mjs 526 B
packages/a2ui-renderer/dist/web-components/catalog/basic/list.cjs 534 B
packages/a2ui-renderer/dist/web-components/catalog/basic/list.mjs 483 B
packages/a2ui-renderer/dist/web-components/catalog/basic/modal.cjs 842 B
packages/a2ui-renderer/dist/web-components/catalog/basic/modal.mjs 800 B
packages/a2ui-renderer/dist/web-components/catalog/basic/row.cjs 471 B
packages/a2ui-renderer/dist/web-components/catalog/basic/row.mjs 427 B
packages/a2ui-renderer/dist/web-components/catalog/basic/slider.cjs 701 B
packages/a2ui-renderer/dist/web-components/catalog/basic/slider.mjs 653 B
packages/a2ui-renderer/dist/web-components/catalog/basic/tabs.cjs 780 B
packages/a2ui-renderer/dist/web-components/catalog/basic/tabs.mjs 730 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text-field.cjs 857 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text-field.mjs 814 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text.cjs 553 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text.mjs 501 B
packages/a2ui-renderer/dist/web-components/catalog/basic/utils.cjs 484 B
packages/a2ui-renderer/dist/web-components/catalog/basic/utils.mjs 462 B
packages/a2ui-renderer/dist/web-components/catalog/basic/video.cjs 400 B
packages/a2ui-renderer/dist/web-components/catalog/basic/video.mjs 352 B
packages/a2ui-renderer/dist/web-components/catalog/children.cjs 302 B
packages/a2ui-renderer/dist/web-components/catalog/children.mjs 300 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/button.cjs 629 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/button.mjs 584 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/column.cjs 609 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/column.mjs 559 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/components.cjs 245 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/components.mjs 263 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/index.cjs 724 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/index.mjs 654 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/row.cjs 593 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/row.mjs 544 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text-field.cjs 874 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text-field.mjs 822 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text.cjs 509 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text.mjs 477 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/utils.cjs 291 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/utils.mjs 287 B
packages/a2ui-renderer/dist/web-components/create-catalog.cjs 1.89 kB
packages/a2ui-renderer/dist/web-components/create-catalog.mjs 1.83 kB
packages/a2ui-renderer/dist/web-components/define.cjs 440 B
packages/a2ui-renderer/dist/web-components/define.mjs 341 B
packages/a2ui-renderer/dist/web-components/index.cjs 960 B
packages/a2ui-renderer/dist/web-components/index.mjs 655 B
packages/a2ui-renderer/dist/web-components/node.cjs 1.05 kB
packages/a2ui-renderer/dist/web-components/node.mjs 1.04 kB
packages/a2ui-renderer/dist/web-components/surface.cjs 2.83 kB
packages/a2ui-renderer/dist/web-components/surface.mjs 2.81 kB
packages/core/dist/index.cjs 54.1 kB
packages/core/dist/index.mjs 53.7 kB
packages/core/dist/index.umd.js 57.8 kB
packages/react-core/dist/copilotkit-DOMr3DRO.cjs 111 kB
packages/react-core/dist/copilotkit-ykQW_VJZ.mjs 110 kB
packages/react-core/dist/index.cjs 17 kB
packages/react-core/dist/index.mjs 16.9 kB
packages/react-core/dist/index.umd.js 65.8 kB
packages/react-core/dist/v2/context.cjs 1.55 kB
packages/react-core/dist/v2/context.mjs 1.47 kB
packages/react-core/dist/v2/headless.cjs 13.7 kB
packages/react-core/dist/v2/headless.mjs 13.1 kB
packages/react-core/dist/v2/index.cjs 1.32 kB
packages/react-core/dist/v2/index.mjs 1.13 kB
packages/react-core/dist/v2/index.umd.js 111 kB
packages/react-native/dist/chunk-C0xms8kb.cjs 546 B
packages/react-native/dist/components/index.cjs 8.25 kB
packages/react-native/dist/components/index.mjs 8.06 kB
packages/react-native/dist/headless.cjs 630 B
packages/react-native/dist/headless.mjs 371 B
packages/react-native/dist/index.cjs 6.52 kB
packages/react-native/dist/index.mjs 6.15 kB
packages/react-native/dist/polyfills.cjs 158 B
packages/react-native/dist/polyfills.mjs 160 B
packages/react-native/dist/polyfills/crypto.cjs 373 B
packages/react-native/dist/polyfills/crypto.mjs 381 B
packages/react-native/dist/polyfills/dom.cjs 540 B
packages/react-native/dist/polyfills/dom.mjs 550 B
packages/react-native/dist/polyfills/encoding.cjs 332 B
packages/react-native/dist/polyfills/encoding.mjs 307 B
packages/react-native/dist/polyfills/location.cjs 236 B
packages/react-native/dist/polyfills/location.mjs 244 B
packages/react-native/dist/polyfills/streams.cjs 371 B
packages/react-native/dist/polyfills/streams.mjs 339 B
packages/react-native/dist/streaming-fetch-BnQh3vBz.mjs 2.22 kB
packages/react-native/dist/streaming-fetch-BTESzLKX.cjs 2.27 kB
packages/react-native/dist/useRenderTool-CKEPq7MQ.cjs 2.09 kB
packages/react-native/dist/useRenderTool-l7M-I8rT.mjs 1.95 kB
packages/react-textarea/dist/index.cjs 18.1 kB
packages/react-textarea/dist/index.mjs 17.4 kB
packages/react-textarea/dist/index.umd.js 18.8 kB
packages/react-ui/dist/index.cjs 25.1 kB
packages/react-ui/dist/index.mjs 24.4 kB
packages/react-ui/dist/index.umd.js 26.3 kB
packages/runtime-client-gql/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/runtime-client-gql/dist/client/conversion.cjs 1.52 kB
packages/runtime-client-gql/dist/client/conversion.mjs 1.45 kB
packages/runtime-client-gql/dist/client/CopilotRuntimeClient.cjs 1.58 kB
packages/runtime-client-gql/dist/client/CopilotRuntimeClient.mjs 1.54 kB
packages/runtime-client-gql/dist/client/types.cjs 701 B
packages/runtime-client-gql/dist/client/types.mjs 642 B
packages/runtime-client-gql/dist/graphql/@generated/gql.cjs 850 B
packages/runtime-client-gql/dist/graphql/@generated/gql.mjs 850 B
packages/runtime-client-gql/dist/graphql/@generated/graphql.cjs 2.4 kB
packages/runtime-client-gql/dist/graphql/@generated/graphql.mjs 2.36 kB
packages/runtime-client-gql/dist/graphql/definitions/mutations.cjs 740 B
packages/runtime-client-gql/dist/graphql/definitions/mutations.mjs 732 B
packages/runtime-client-gql/dist/graphql/definitions/queries.cjs 316 B
packages/runtime-client-gql/dist/graphql/definitions/queries.mjs 304 B
packages/runtime-client-gql/dist/index.cjs 679 B
packages/runtime-client-gql/dist/index.mjs 495 B
packages/runtime-client-gql/dist/index.umd.js 9.58 kB
packages/runtime-client-gql/dist/message-conversion/agui-to-gql.cjs 1.72 kB
packages/runtime-client-gql/dist/message-conversion/agui-to-gql.mjs 1.7 kB
packages/runtime-client-gql/dist/message-conversion/gql-to-agui.cjs 1.56 kB
packages/runtime-client-gql/dist/message-conversion/gql-to-agui.mjs 1.53 kB
packages/runtime-client-gql/dist/package.cjs 181 B
packages/runtime-client-gql/dist/package.mjs 116 B
packages/shared/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/shared/dist/a2ui-prompts.cjs 2.85 kB
packages/shared/dist/a2ui-prompts.mjs 2.85 kB
packages/shared/dist/attachments/utils.cjs 1.74 kB
packages/shared/dist/attachments/utils.mjs 1.7 kB
packages/shared/dist/constants/index.cjs 362 B
packages/shared/dist/constants/index.mjs 345 B
packages/shared/dist/debug.cjs 454 B
packages/shared/dist/debug.mjs 452 B
packages/shared/dist/finalize-events.cjs 1.05 kB
packages/shared/dist/finalize-events.mjs 1 kB
packages/shared/dist/index.cjs 2.03 kB
packages/shared/dist/index.mjs 1.69 kB
packages/shared/dist/index.umd.js 21.5 kB
packages/shared/dist/logger.cjs 112 B
packages/shared/dist/logger.mjs 112 B
packages/shared/dist/package.cjs 181 B
packages/shared/dist/package.mjs 116 B
packages/shared/dist/standard-schema.cjs 740 B
packages/shared/dist/standard-schema.mjs 737 B
packages/shared/dist/telemetry/lambda-client.cjs 1.14 kB
packages/shared/dist/telemetry/lambda-client.mjs 1.13 kB
packages/shared/dist/telemetry/telemetry-client.cjs 1.33 kB
packages/shared/dist/telemetry/telemetry-client.mjs 1.27 kB
packages/shared/dist/telemetry/utils.cjs 321 B
packages/shared/dist/telemetry/utils.mjs 277 B
packages/shared/dist/transcription-errors.cjs 951 B
packages/shared/dist/transcription-errors.mjs 944 B
packages/shared/dist/utils/clipboard.cjs 407 B
packages/shared/dist/utils/clipboard.mjs 405 B
packages/shared/dist/utils/conditions.cjs 540 B
packages/shared/dist/utils/conditions.mjs 536 B
packages/shared/dist/utils/console-styling.cjs 1.24 kB
packages/shared/dist/utils/console-styling.mjs 1.22 kB
packages/shared/dist/utils/errors.cjs 4.51 kB
packages/shared/dist/utils/errors.mjs 4.41 kB
packages/shared/dist/utils/index.cjs 1.4 kB
packages/shared/dist/utils/index.mjs 1.67 kB
packages/shared/dist/utils/inspector-metadata.cjs 1.46 kB
packages/shared/dist/utils/inspector-metadata.mjs 1.45 kB
packages/shared/dist/utils/json-schema.cjs 1.97 kB
packages/shared/dist/utils/json-schema.mjs 1.91 kB
packages/shared/dist/utils/random-id.cjs 618 B
packages/shared/dist/utils/random-id.mjs 559 B
packages/shared/dist/utils/requests.cjs 706 B
packages/shared/dist/utils/requests.mjs 704 B
packages/shared/dist/utils/types.cjs 161 B
packages/shared/dist/utils/types.mjs 160 B
packages/voice/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/voice/dist/index.cjs 175 B
packages/voice/dist/index.mjs 95 B
packages/voice/dist/index.umd.js 1.5 kB
packages/voice/dist/transcription/transcription-service-openai.cjs 495 B
packages/voice/dist/transcription/transcription-service-openai.mjs 434 B
packages/web-inspector/dist/assets/inspector-logo-kite.cjs 2.36 kB
packages/web-inspector/dist/assets/inspector-logo-kite.mjs 2.3 kB
packages/web-inspector/dist/assets/inspector-logo.cjs 4.32 kB
packages/web-inspector/dist/assets/inspector-logo.mjs 4.23 kB
packages/web-inspector/dist/index.cjs 92.7 kB
packages/web-inspector/dist/index.mjs 92.7 kB
packages/web-inspector/dist/index.umd.js 132 kB
packages/web-inspector/dist/lib/context-helpers.cjs 862 B
packages/web-inspector/dist/lib/context-helpers.mjs 830 B
packages/web-inspector/dist/lib/home-briefing.cjs 2.36 kB
packages/web-inspector/dist/lib/home-briefing.mjs 2.36 kB
packages/web-inspector/dist/lib/inspector-metadata.cjs 760 B
packages/web-inspector/dist/lib/inspector-metadata.mjs 750 B
packages/web-inspector/dist/lib/inspector-nav.cjs 668 B
packages/web-inspector/dist/lib/inspector-nav.mjs 649 B
packages/web-inspector/dist/lib/persistence.cjs 2.18 kB
packages/web-inspector/dist/lib/persistence.mjs 2.11 kB
packages/web-inspector/dist/lib/pop-out.cjs 1.07 kB
packages/web-inspector/dist/lib/pop-out.mjs 1.05 kB
packages/web-inspector/dist/lib/telemetry.cjs 3.83 kB
packages/web-inspector/dist/lib/telemetry.mjs 3.7 kB
packages/web-inspector/dist/lib/thread-selection.cjs 566 B
packages/web-inspector/dist/lib/thread-selection.mjs 563 B
packages/web-inspector/dist/package.cjs 181 B
packages/web-inspector/dist/package.mjs 116 B
packages/web-inspector/dist/styles/generated.cjs 17 kB
packages/web-inspector/dist/styles/generated.mjs 16.9 kB

compressed-size-action

@BenTaylorDev
BenTaylorDev marked this pull request as ready for review August 21, 2026 13:07
BenTaylorDev added a commit that referenced this pull request Aug 21, 2026
…ation (#6618)

Retires the v1 runtime adapter from `showcase/integrations/`. After
this, **no code under `showcase/integrations/` calls
`copilotRuntimeNextJSAppRouterEndpoint`** — 239 routes across 20
integrations.

This is the cheap path we discussed: single-route mode, which is a
genuine drop-in. **No demo page changes, no route path changes, no `GET`
exports, no new dependencies.**

## The shape

```ts
const copilotHandler = createCopilotRuntimeHandler({
  runtime,
  basePath: "/api/copilotkit-x",
  mode: "single-route",
});
...
return await copilotHandler(req);
```

**Why single-route:** these demos' frontends are `<CopilotKit
runtimeUrl="/api/copilotkit-x">` with no transport prop, and every
released provider pins the single-route transport. So single-route mode
is what the v1 adapter was already serving. Migrating to multi-route
instead would have meant editing every demo page in lockstep, for no
functional gain — nothing in the showcase probes `/info`.

**Why `createCopilotRuntimeHandler`** rather than
`createCopilotEndpointSingleRoute`: that helper is itself deprecated in
favour of the `mode` option (per the deprecated-aliases table in
`docs/backend/runtime-endpoints.mdx`), and the fetch handler needs no
`hono` dependency and composes directly with the wrappers these routes
already have.

The statement is rewritten **in place**, inside whatever wrapper it
already sat in, so `withForwardedHeaders`, the try/catch envelopes,
`wrapStreamingResponse` and `withCvdiagBackend` are untouched. 75 of
these routes construct the runtime inline in the call; rewriting in
place preserves that per-request construction exactly as v1 did. No
`runner` is added — it's optional and none of these routes passed one.

13 `copilotkit-auth/[[...slug]]` routes already use the v2 fetch handler
and are left alone; they only name v1 in comments.

## Verified

The shape was proved end-to-end **before** the rollout, in a real
running app with an untouched provider (aimock as the model backend):
`POST /api/copilotkit` → 200 twice, chat turn rendered in the browser.
It also typechecks against the exact version these integrations pin
(1.68.2).

`mastra` is the integration installed and exercised locally — 19 routes,
the `withCvdiagBackend` main route, and the only vitest suites that
touch routes. Measured against `origin/main` **in the same tree**:

| | baseline (`origin/main`) | after |
| --- | --- | --- |
| `tsc --noEmit` | errors in 10 files | errors in **9** |
| `vitest run` | 2 files / 13 tests failed, 21 passed | 2 files / 13
tests failed, 21 passed |

- **New type errors introduced: none.**
- **Fixed:** `src/app/api/copilotkit-mcp-apps/route.ts`, whose
`@ts-expect-error` was *already* unused on `main`.
- **Test-neutral:** those 13 failures are pre-existing on `main` (mostly
`extractXHeaders` dereferencing `req.headers` on a `{}` fake request).

Structural audit over all 239 routes, re-run after the pre-commit
formatter: none still imports the v1 root, calls the v1 adapter,
references `ExperimentalEmptyAdapter` or `handleRequest` in code, or is
missing `createCopilotRuntimeHandler` / `basePath` / `mode:
"single-route"`.

**CI has now built all 21 integrations green** — `showcase_build_check`
Docker-builds each changed integration and `next build` typechecks
inside it. That covers the ones I could not stand up locally, including
the non-JS backends (`spring-ai`, `ms-agent-dotnet`, `ms-agent-python`,
`ms-agent-harness-dotnet`, `langroid`, `strands`). Full run: 41 pass / 3
skip / 0 fail.

To be precise about what each gate proves: CI proves these 21 apps still
**build and typecheck**. It does not exercise a chat turn per
integration — that came from the pre-rollout live proof of the shape
itself, plus mastra's local test suite.

## Runtime verification on real cells

Docker is not running on my machine, and `bin/showcase test --d6
--direct` requires it
(`--direct` only swaps the in-process driver for the fleet
control-plane; the containers are
not optional). **So the sanctioned Iron Rule 4 probe has NOT been run**
— that gap is real and
a reviewer should weigh it. What I did instead was run a real
integration directly.

`showcase/integrations/mastra` on this branch, `npm run dev`, aimock as
the model backend.
Probing eight migrated routes with the exact envelope the released
provider sends
(`POST {basePath}` with `{"method":"info"}`) — all **200** with real
runtime payloads:

    copilotkit-multimodal          200   agents: multimodal-demo
    copilotkit-mcp-apps            200   agents: headless-complete
    copilotkit-a2ui-fixed-schema   200   agents: a2ui-fixed-schema
    copilotkit-beautiful-chat      200   agents: beautiful-chat
    copilotkit-agent-config        200   agents: agent-config-demo
    copilotkit-ogui                200   agents: open-gen-ui
    copilotkit-declarative-gen-ui  200   agents: declarative-gen-ui
    copilotkit-background-agents   200   agents: background-agents

Then three real demo cells driven in a browser, each rendering and
completing a chat turn
through its migrated route (two POSTs, both 200, assistant message
rendered):

/demos/beautiful-chat -> POST /api/copilotkit-beautiful-chat 200, 200
/demos/a2ui-fixed-schema -> POST /api/copilotkit-a2ui-fixed-schema 200,
200
/demos/multimodal -> POST /api/copilotkit-multimodal 200, 200

Deliberately spread across different route configs — plain, `a2ui`, and
a dedicated
vision-model route — rather than three variations of the same one.

### One route is 500, and it is pre-existing

`POST /api/copilotkit` (mastra's main route) returns 500 in dev:
`module-not-found` on
`./schema.js` from `src/cvdiag/cvdiag-emitter.ts`. `schema.ts` **is**
tracked and present —
Turbopack in dev just does not resolve the ESM-style `.js` specifier to
it. Proven
pre-existing by restoring **only** that file to `origin/main` and
re-probing: same 500 on the
v1 code. Its Docker build passes, which is why CI is green.

### A mistake in my own verification, recorded

My first pass at the above ran against the wrong branch — I was still on
the docs branch,
where these routes are v1, so the first six 200s I collected were the
**v1** routes. Caught it,
switched to this branch, and re-ran everything above against the
migrated code. The accidental
run was not wasted: it independently confirms the premise of this PR,
that the v1 adapter and
v2 single-route mode answer the same envelope the same way.

## Judgement call worth reviewing

27 `@ts-expect-error` directives guarded the **v1** `CopilotRuntime`
agents type ("wraps `Record` in `MaybePromise<NonEmptyRecord<...>>`").
Under `/v2` that hole is gone, which makes the directive *unused* — a
hard compile error.

I demoted them to `@ts-ignore`, which compiles whether or not the
mismatch survives in a given integration. The honest reason at the time:
19 of these apps can't be built locally, so I couldn't prove per-file
which still need a suppression, and `@ts-ignore` is what 190 sibling
files already use.

Now that CI has built all 21 green, that constraint is gone — the ~220
now-stale suppressions (all of which cite a **v1** type hole that no
longer applies) can be removed and verified by the same 21 builds. I've
left them in place here to keep this PR mechanical and reviewable; say
the word and I'll do it as a second pass.

## Two pre-existing problems found on the way

- **`npm ci` fails in `showcase/integrations/mastra`**: `Missing:
@types/[email protected] from lock file`. The Dockerfile uses `npm ci
--legacy-peer-deps`, which *does* succeed, so the image still builds —
but a plain `npm ci` doesn't. No manifest or lockfile is in this diff.
- **`mastra`'s vitest suite is red on `main`** — 13 failures, as tabled
above.

## What's left of the v1 entrypoint

| Surface | Before | After |
| --- | --- | --- |
| `showcase/integrations/**` | 239 | **0** |
| `examples/v1/**` | 12 | 12 (deliberately v1, never in scope) |
| everything else in `examples/` | ~61 | ~61 (not in this PR) |

Stacks cleanly with #6617 (docs) — no file overlap. It also **unblocks
the two Claude SDK quickstart pages** I had to revert there:
single-route keeps the starter file at the plain `route.ts` path, so
those pages' prose claims and `verify-shell-docs.ts` starter-path checks
stay valid, and only the fence body needs updating.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
BenTaylorDev and others added 7 commits August 21, 2026 08:32
`examples/shadcn` paired a v1, POST-only runtime route with a
`@copilotkit/react-core/v2` frontend. `GET /api/copilotkit` answered 405 and
`GET /api/copilotkit/info` did not route at all (404), so nothing could probe
the runtime.

Convert the route to the v2 multi-route shape at a catch-all path, exporting
both verbs:

  app/api/copilotkit/[[...slug]]/route.ts
  createCopilotEndpoint({ runtime, basePath: "/api/copilotkit" })
  export const GET = handle(app)
  export const POST = handle(app)

Two co-changes this shape requires, both found by running the app rather than
by reading it:

- `hono` becomes a direct dependency. It is a dependency of
  `@copilotkit/runtime`, not a peer, so under pnpm's strict layout
  `import { handle } from "hono/vercel"` does not resolve from the app
  without declaring it.
- the provider must pass `useSingleEndpoint={false}`. The published
  `<CopilotKit>` from `@copilotkit/react-core/v2` defaults to the
  single-route transport, which posts a single-route envelope to the bare
  basePath; a multi-route runtime answers that with 404. The runtime says so
  itself in the error body.

`@copilotkit/*` moves 1.61.2 -> 1.68.3 so the app runs the versions a reader
installing today would get.

Verified live (aimock on :4010 as the model backend):
  GET  /api/copilotkit/info              -> 200, runtime /info payload
  POST /api/copilotkit/agent/default/run -> 200, chat turn renders
  before: GET /api/copilotkit -> 405, GET /api/copilotkit/info -> 404
  tsc --noEmit, eslint, next build all clean

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`snippets/copilot-runtime.mdx` calls itself "the recommended way to use
CopilotKit" and taught the v1 plain-POST route. A reader following it got an
endpoint that answers 405 on `GET /api/copilotkit` and does not route
`GET /api/copilotkit/info` at all, so nothing could discover the runtime.

The route fence is now the shape proved in `examples/shadcn`: catch-all path,
`createCopilotEndpoint`, a runner, and both verbs exported. The three other
fences on the page that were titled with the plain route path are retitled to
the catch-all path, so no snippet claims a path its body contradicts.

Also documents the two things the shape actually requires, both of which were
found by running it:

- `npm install @copilotkit/runtime hono` — `hono` is a dependency of the
  runtime rather than a peer, so `hono/vercel` resolves under npm's flat
  layout but not under pnpm.
- `useSingleEndpoint={false}` on `<CopilotKit>`. The provider defaults it to
  `true` (single-route transport), which posts to the bare `runtimeUrl`; a
  multi-route runtime answers that with 404. The Angular provider defaults its
  transport to `"auto"` and needs no equivalent change, so that snippet is
  unchanged.

## The snippet is now gated in CI

`scripts/doc-tests` already extracts fences tagged `doctest=` and, for
`component`, runs `tsc --noEmit` against real npm-installed dependencies — but
it could not handle a fence whose title is a path, which is exactly what a
Next.js route handler's title is. Two defects blocked it, both fixed here:

- `extract.ts` wrote the title as a path without creating intermediate
  directories, so a titled route fence died on ENOENT.
- `run.ts` derived the npm package name from the snippet directory, and a
  catch-all leaf directory is literally `[[...slug]]`, which npm rejects as an
  invalid name. It also looked for `doctest.json` only in the snippet's own
  directory, while the sidecar is copied once per page — so a nested snippet
  silently installed no dependencies and failed with "Cannot find module".

With those fixed, the canonical route snippet is tagged `doctest="component"`
and typechecked in CI against the published `@copilotkit/runtime` 1.68.3 and
`hono`. This is the gate the docs did not have: snippet correctness no longer
rests on review alone.

Verified:
  pnpm tsx scripts/doc-tests/extract.ts  -> 2 snippets extracted
  pnpm tsx scripts/doc-tests/run.ts      -> 2 passed, 0 failed
  mutation check: restoring the v1 import in the fence turns the run red
  (1 passed, 1 failed), so the gate fails on the regression it exists to catch
  vitest scripts/doc-tests/__tests__/extract.test.ts -> 10 passed

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Migrates the Next.js App Router runtime fences across the docs from the v1
entrypoint to the v2 multi-route shape proved in `examples/shadcn`: catch-all
path, `createCopilotEndpoint`, a runner, and both verbs exported. 38 fences
across 33 pages.

Only the boilerplate is rewritten. Each page's agent wiring — `MastraAgent`,
`LangGraphAgent`, `HttpAgent`, `BuiltInAgent`, middleware `.use(...)` calls —
is left byte-identical, because that part is not what was broken.

Three co-changes travel with every migrated page, since the shape does not work
without them:

- `hono` added to the page's install command (20 lines). It is a dependency of
  `@copilotkit/runtime`, not a peer, so `hono/vercel` resolves under npm's flat
  layout but not under pnpm.
- `useSingleEndpoint={false}` on `<CopilotKit>` (27 provider tags). The
  provider defaults to the single-route transport, which posts to the bare
  `runtimeUrl`; a multi-route runtime answers with 404. Only tags carrying a
  `runtimeUrl` are touched — a provider using `agents__unsafe_dev_only` has no
  runtime to match. Angular's `provideCopilotKit` defaults its transport to
  `"auto"` and needs no equivalent, so those snippets are unchanged.
- fence titles retitled to the catch-all path, plus the prose that introduces
  them, so no snippet claims a path its body contradicts.

`LangGraphAgent` moves from the v1 root entrypoint to
`@copilotkit/runtime/langgraph` on one page. Both spellings resolve, but the
subpath is the one that survives the v1 entrypoint; verified by typechecking
`LangGraphAgent` + v2 `CopilotRuntime` + `createCopilotEndpoint` together
against the published 1.68.3.

## Two mistakes worth recording, since both were caught by a check rather than by reading

A block regex scoped to the fence's opening indentation corrupted five
quickstart pages: their fences open and close at *different* indentation, so
the match ran past the closing backticks and re-indented the following
`</Step>` / `</Tab>` boundary into the code block. The five pages were reverted
and redone with a line-oriented pass that never re-indents anything and
re-emits the original closing line verbatim.

Every modified page is now checked structurally — fence-marker count and the
full set of JSX structural lines, indentation included, must be identical to
`HEAD`. All 33 pass. That check is what found the corruption; a diff review had
already missed it on the first pass.

## Verified

    pnpm tsx scripts/doc-tests/extract.ts   -> 2 snippets
    pnpm tsx scripts/doc-tests/run.ts       -> 2 passed, 0 failed
    showcase/shell-docs: pnpm typecheck     -> exit 0
    showcase/shell-docs: pnpm lint          -> exit 0 (pre-existing warnings only)
    showcase/shell-docs: pnpm build         -> exit 0
    structural audit: 33/33 pages, fence + JSX structure identical to HEAD

Note this validates that the pages still build and that the one doctested
snippet compiles. It does not execute the other 37 fences. Their correctness
rests on Stage 0: the boilerplate they now contain is the text that was run in
`examples/shadcn`, and their agent wiring is untouched.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Finishes the tractable remainder of the v1 -> v2 runtime sweep, and fixes a
docs claim that the previous commit's `useSingleEndpoint={false}` edits exposed
as wrong.

## The pairing guidance described unreleased behaviour

`backend/runtime-endpoints.mdx` is the authoritative page for provider/handler
pairs, and it said omitting `useSingleEndpoint` is safe on either provider
because the client negotiates from `/info` — with `auth.mdx` and two quickstart
callouts repeating it. That is true on `main` and false in every published
release: the compat `<CopilotKit>` wrapper still ships

    useSingleEndpoint={props.useSingleEndpoint ?? true}

(verified in the published `@copilotkit/react-core` 1.68.3 bundle), so omitting
the prop selects the single-route transport and 404s against a multi-route
Runtime. The Runtime's own error body says so. `<CopilotKitProvider>` does
negotiate; only the wrapper pins — and every docs snippet uses the wrapper.

So the pairing table now splits the two providers instead of grouping them,
states that the pin exists in released versions and is removed on `main`, and
says plainly that passing `{false}` is the forward-compatible choice. The
"pinning the wrong mode 404s silently" warning now covers omitting the prop on
`<CopilotKit>`, which is the same failure by a different route. Same correction
applied to `auth.mdx` and to the two "Which provider goes with which handler?"
callouts, which additionally still named `copilotRuntimeNextJSAppRouterEndpoint`
as the route above them after that route became `createCopilotEndpoint`.

## Remaining migrations

- `self-hosting-remote-endpoints.mdx` — three LangGraph fragments moved to
  `@copilotkit/runtime/v2` for `CopilotRuntime` and
  `@copilotkit/runtime/langgraph` for the agents, splitting what was a single
  v1 root import.
- `copilot-runtime.mdx` — the transport callout rewritten to match the
  authoritative page and link to it, rather than asserting the default itself.

## Verified

    pnpm tsx scripts/doc-tests/run.ts     -> 2 passed, 0 failed
    showcase/shell-docs: pnpm typecheck   -> exit 0
    showcase/shell-docs: pnpm build       -> exit 0
    structural audit: 6/6 mdx files, fence + JSX structure identical to HEAD

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Seven fences already imported from `@copilotkit/runtime/v2` but were still
titled `app/api/copilotkit/route.ts`. That is the same title/body mismatch this
sweep exists to fix, seen from the other side: a reader follows the title,
creates a plain route file for a runtime that needs the catch-all path, and gets
no `/info`.

Titles only — no bodies changed.

Two categories are deliberately left on the plain path, because there it is
correct:

- fences mentioning `createCopilotEndpointSingleRoute`. Single-route mode is
  served from a plain `route.ts` and is POST-only by design; retitling one would
  destroy what it demonstrates.
- fences still on the v1 entrypoint. Those are separate migrations, blocked for
  the reasons recorded in the PR description.

Verified:
    pnpm tsx scripts/doc-tests/run.ts   -> 2 passed, 0 failed
    showcase/shell-docs: pnpm build     -> exit 0

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The earlier commits in this PR taught `createCopilotEndpoint` paired with
`handle` from `hono/vercel`, and added `hono` to 20 install commands with a
callout explaining why readers must install it. Both were wrong, and the second
was a consequence of the first.

`createCopilotEndpoint` is a **deprecated alias**. This repo's own handler table
says so — `docs/backend/runtime-endpoints.mdx`:

    | Deprecated                          | Use instead                |
    | `createCopilotEndpoint`             | `createCopilotHonoHandler` |
    | `createCopilotEndpointSingleRoute`  | ... with mode: "single-route" |

`createCopilotRuntimeHandler` serves the same multi-route mode (it is the
default), returns a plain fetch handler, is not deprecated, and needs **no hono
at all**. So the route collapses to:

    const handler = createCopilotRuntimeHandler({
      runtime,
      basePath: "/api/copilotkit",
    });

    export const GET = handler;
    export const POST = handler;

`hono` was therefore an artifact of the shape, not a requirement of the library.
The install lines and the callout are reverted; nothing tells readers to install
it any more.

## Verified with hono deleted, not merely absent from package.json

`examples/shadcn` converted to this shape, `hono` removed from its
`package.json`, and `node_modules/hono` deleted outright so a hoisted copy could
not mask the result:

    GET  /api/copilotkit/info              -> 200
    POST /api/copilotkit/agent/default/run -> 200, chat turn rendered
    tsc --noEmit / eslint / next build     -> clean
    next build route                       -> ƒ /api/copilotkit/[[...slug]]

The doctest sidecar drops `hono` too, so the CI gate now typechecks the
canonical snippet against `@copilotkit/runtime` alone — proof by construction
that the snippet needs nothing else.

    pnpm tsx scripts/doc-tests/run.ts   -> 2 passed, 0 failed
    showcase/shell-docs: typecheck      -> exit 0
    showcase/shell-docs: build          -> exit 0
    structural audit: 31/31 mdx files, fence + JSX identical to HEAD

## Also corrected

`docs/backend/custom-agent.mdx` repeated the same incorrect transport claim the
earlier commit fixed in four other places ("Both `<CopilotKit>` and
`<CopilotKitProvider>` negotiate the transport when the prop is omitted").
Corrected to match released behaviour.

## Left alone deliberately

`snippets/shared/backend/custom-agent.mdx` and `docs/backend/custom-agent.mdx`
still call `createCopilotEndpoint` in three fences each, as
`export default copilotEndpoint` — the Hono-app deployment pattern rather than a
Next.js route handler. That predates this PR, the documented replacement is
`createCopilotHonoHandler`, and I have not run that shape. Recorded as follow-up
rather than guessed at. (The two files have also drifted from each other, which
is a separate problem.)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…arts

Two things this PR was missing, both now closed.

## The Claude SDK quickstarts are unblocked

#6618 put `showcase/integrations/claude-sdk-{python,typescript}` on
`createCopilotRuntimeHandler` with `mode: "single-route"`, at the **plain**
`route.ts` path. That dissolves the coupling that forced these two pages to be
reverted earlier: `verify-shell-docs.ts` asserts each page claims a starter file
at `src/app/api/copilotkit/route.ts` AND that the file exists in the extracted
starter. Single-route keeps that path, so the prose claims and
`requiredStarterFiles` are unchanged — only the fence bodies move to v2.

The two content assertions that pinned those pages to v1
(`ExperimentalEmptyAdapter`, `copilotRuntimeNextJSAppRouterEndpoint`) now
require `createCopilotRuntimeHandler`, the `/v2` entrypoint,
`mode: "single-route"` and a `POST` export. Mutation-checked: flipping the
fixture to `mode: "multi-route"` fails with
`app/api/copilotkit/route.ts missing single-route mode`.

## Snippet gating: 1 -> 20 route fences

I previously claimed the integration pages could not be doctested because of
path aliases and per-integration deps. **That was an assumption I never
checked, and it was wrong.** Of the 52 migrated route fences, 47 import nothing
project-relative; 36 are complete, self-standing routes. 27 pages were
eligible, 20 now hold a gated fence — each extracted and typechecked by
`tsc --noEmit` against real npm-installed packages in CI.

One fence per (page, title): `extract.ts` concatenates tagged blocks sharing a
title, so a second complete route on the same page would collide.

Mutation-checked on `snippets/integrations/langsmith/index.mdx`: restoring the
v1 import in the gated fence turns the run red (20 passed, 1 failed). My first
attempt at this check was a no-op — the pattern missed because the fence is
JSX-indented — and it "passed" misleadingly. The real check asserts the mutation
reached the extracted snippet before trusting the result.

### Harness changes this needed

- `extract.ts` now finds the nearest `doctest.json` by walking up to the docs
  root, instead of looking only in the page's own directory. Otherwise gating
  20 pages means ~20 duplicated dependency lists that then drift. A shared list
  lives at `content/doctest.json`; `docs/integrations/langgraph/` keeps its own
  (Python deps) and now also carries the TS deps its page needs.
- `run.ts` installs each dependency set **once**, into
  `.doctest-output/.deps/<hash>`, and links it into every snippet sharing that
  set. Per-snippet installs took **7:58** for 21 snippets, uncomfortably close
  to the job's 15-minute timeout; shared installs take **0:45** cold. Different
  dep sets still get separate stores, so this is a dedupe, not a merge.

### `@ag-ui/*` versions have to be pinned to what the runtime expects

Unpinned, the gated fences failed with `HttpAgent is not assignable to
AbstractAgent — separate declarations of a private property '_debug'`: npm
installs a newer `@ag-ui/client` than `@copilotkit/runtime` depends on, so two
`AbstractAgent` declarations collide. The sidecar pins `@ag-ui/[email protected]` and
`@ag-ui/[email protected]` to match `@copilotkit/[email protected]`.

## Seven fences are deliberately NOT gated

Un-tagged with the reason, rather than left failing or quietly dropped:

- `docs/auth.mdx`, `docs/premium/connect-your-runtime.mdx` — illustrative
  fences referencing placeholders (`myAgent`, `verifyJwt`) that cannot compile
  standalone by design.
- the four langgraph-family pages and
  `snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx` — these hit
  `LangGraphAgent is not assignable to AbstractAgent — separate declarations of
  a private property '_debug'`, which pinning does not fix.

**That last one is a real pre-existing defect, not a migration regression.** I
reconstructed the v1 form of the langgraph quickstart snippet verbatim from
`origin/main` and typechecked it against the identical installed dependencies:
it fails with the same error. So these snippets have never typechecked against
published packages — worth filing separately. It is also what the ~220
`@ts-ignore` comments across `showcase/integrations` were papering over.

## Verified

    doc-tests (cold, no cache)          -> 21 passed, 0 failed in 0:45
    mutation check (real, verified)     -> 20 passed, 1 failed
    vitest extract + verify-shell-docs  -> 34 passed
    showcase/shell-docs typecheck       -> exit 0
    showcase/shell-docs build           -> exit 0
    structural audit                    -> 21/21 pages, fence + JSX identical to HEAD

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@BenTaylorDev
BenTaylorDev force-pushed the ben1/v2-runtime-migration branch from 7209108 to 5ca110e Compare August 21, 2026 14:28
@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@copilotkit/a2ui-renderer

pnpm add https://pkg.pr.new/@copilotkit/a2ui-renderer@6617

@copilotkit/agentcore-runner

pnpm add https://pkg.pr.new/@copilotkit/agentcore-runner@6617

@copilotkit/angular

pnpm add https://pkg.pr.new/@copilotkit/angular@6617

@copilotkit/channels

pnpm add https://pkg.pr.new/@copilotkit/channels@6617

@copilotkit/channels-core

pnpm add https://pkg.pr.new/@copilotkit/channels-core@6617

@copilotkit/channels-discord

pnpm add https://pkg.pr.new/@copilotkit/channels-discord@6617

@copilotkit/channels-intelligence

pnpm add https://pkg.pr.new/@copilotkit/channels-intelligence@6617

@copilotkit/channels-slack

pnpm add https://pkg.pr.new/@copilotkit/channels-slack@6617

@copilotkit/channels-teams

pnpm add https://pkg.pr.new/@copilotkit/channels-teams@6617

@copilotkit/channels-telegram

pnpm add https://pkg.pr.new/@copilotkit/channels-telegram@6617

@copilotkit/channels-ui

pnpm add https://pkg.pr.new/@copilotkit/channels-ui@6617

@copilotkit/channels-whatsapp

pnpm add https://pkg.pr.new/@copilotkit/channels-whatsapp@6617

@copilotkit/core

pnpm add https://pkg.pr.new/@copilotkit/core@6617

@copilotkit/react-core

pnpm add https://pkg.pr.new/@copilotkit/react-core@6617

@copilotkit/react-native

pnpm add https://pkg.pr.new/@copilotkit/react-native@6617

@copilotkit/react-textarea

pnpm add https://pkg.pr.new/@copilotkit/react-textarea@6617

@copilotkit/react-ui

pnpm add https://pkg.pr.new/@copilotkit/react-ui@6617

@copilotkit/runtime

pnpm add https://pkg.pr.new/@copilotkit/runtime@6617

@copilotkit/runtime-client-gql

pnpm add https://pkg.pr.new/@copilotkit/runtime-client-gql@6617

@copilotkit/sdk-js

pnpm add https://pkg.pr.new/@copilotkit/sdk-js@6617

@copilotkit/shared

pnpm add https://pkg.pr.new/@copilotkit/shared@6617

@copilotkit/sqlite-runner

pnpm add https://pkg.pr.new/@copilotkit/sqlite-runner@6617

@copilotkit/voice

pnpm add https://pkg.pr.new/@copilotkit/voice@6617

@copilotkit/vue

pnpm add https://pkg.pr.new/@copilotkit/vue@6617

@copilotkit/web-components

pnpm add https://pkg.pr.new/@copilotkit/web-components@6617

@copilotkit/web-inspector

pnpm add https://pkg.pr.new/@copilotkit/web-inspector@6617

commit: 6e0f577

…tion

# Conflicts:
#	showcase/shell-docs/src/content/snippets/shared/generative-ui/a2ui.mdx
@MikeRyanDev
MikeRyanDev merged commit d2c3b5c into main Aug 21, 2026
83 checks passed
@MikeRyanDev
MikeRyanDev deleted the ben1/v2-runtime-migration branch August 21, 2026 18:07
BenTaylorDev added a commit that referenced this pull request Sep 14, 2026
## Problem

`LangGraphAgent` exported from the `@copilotkit/runtime` **root** is a
deprecation stub whose constructor throws:

```
Error: LangGraphAgent import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
    at new LangGraphAgent (.../dist/lib/index.mjs:25:9)
```

The throw is in the constructor, not at import time, so a file that only
imports the symbol still loads.

Both canvas examples float their runtime pin, so a fresh install
resolves the latest 1.x (1.71.1 today) and gets the stub:

| Example | Pin | Imports from root | Constructs | Effect |
|---|---|---|---|---|
| `examples/canvas/langgraph-python` | `^1.10.4` | yes | yes |
`/api/copilotkit` throws at module load — the example does not boot |
| `examples/canvas/gemini` | `^1.9.3` | yes | no | dead import of a
throw-only stub |

## Fix

- `canvas/langgraph-python`: import `LangGraphAgent` from
`@copilotkit/runtime/langgraph`.
- `canvas/gemini`: drop the unused import.

No behavior change beyond the import path. Two lines.

## Testing

A structural scan of the repo for a **root** import of
`LangGraphAgent`/`LangGraphHttpAgent` that is also constructed. Before
the change, three files matched; after it, none outside dead content:

```
examples/canvas/gemini/.../route.ts:                 dead-import LangGraphAgent
examples/canvas/langgraph-python/.../route.ts:       CONSTRUCTS LangGraphAgent
showcase/shell-docs/.../self-hosting-copilot-runtime-langgraph-endpoint.mdx: CONSTRUCTS LangGraphAgent
```

The third hit is deliberately **not** in this PR — that snippet file is
referenced by nothing in the repo (its siblings are imported as
`@/snippets/<name>.mdx`; this one has no importer), so it is orphaned
content and a separate call. Flagged below.

Before/after against the version the example's own `package.json`
resolves to (`@copilotkit/[email protected]`), replaying the example's
exact route construction:

```
########## BEFORE (root import, as on main) ##########
Error: LangGraphAgent import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
########## AFTER (this PR's import) ##########
after: OK — agent constructed, handleRequest is function
```

End-to-end, the fixed import shape was driven against a live LangGraph
deployment (langgraph 1.2.11 + langchain 1.4.0, `create_agent`),
`@copilotkit/[email protected]`, agent registered exactly as the example
registers it. A full turn streams and completes:

```
   1 "type":"RUN_STARTED"
   1 "type":"TOOL_CALL_START"
   1 "type":"TOOL_CALL_RESULT"
   1 "type":"MESSAGES_SNAPSHOT"
   1 "type":"RUN_FINISHED"
```

No `RUN_ERROR`. `gemini` has no other reference to `LangGraphAgent`, so
removing the import is inert. `oxfmt --check` passes on both files.

Commit hooks were bypassed (this worktree has no `node_modules`, so
lefthook cannot run); `oxfmt --check` was run manually against the
repo's pinned binary instead.

## Follow-up, not in this PR


`showcase/shell-docs/src/content/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx`
has four tabs (Pages Router, Express, Node HTTP, NestJS) still showing
the throwing root import — #6617 converted only the first tab. Nothing
imports the file, so it ships to no reader today. It wants a decision
(wire it up, or delete it) rather than a silent one-line patch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
BenTaylorDev added a commit that referenced this pull request Sep 14, 2026
Follow-up to #7120, which fixed the same defect in the two canvas
examples.

## What this deletes


`showcase/shell-docs/src/content/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx`.

It is dead content, and it is stale content.

**Dead.** shell-docs reaches a snippet by exactly two routes, and the
file is on neither:

1. An MDX import, `@/snippets/<path>` — resolved by `inlineSnippets`. No
file in the repo imports this one.
2. A stub-name entry in `mdx-registry.tsx` / `docs-render.tsx` — read
back by `mdx-registry-loader.tsx` through a mapped relative path. This
file has no entry; its two live siblings,
`self-hosting-copilot-runtime-create-endpoint.mdx` and
`self-hosting-copilot-runtime-configure-copilotkit-provider.mdx`, do.

Nothing enumerates the snippets directory — no glob, no `readdirSync`
over it — so an unreferenced file there is reachable by no code path. A
raw repo-wide grep for the basename also returns nothing.

Its importer was the retired docs app, removed in 33a7948
(2026-06-18). The snippet was left behind.

**Stale.** Four of its five tabs (Pages Router, Express, Node HTTP,
NestJS) still import `LangGraphAgent` from the `@copilotkit/runtime`
root, which is a deprecation stub whose constructor throws on any
version >= 1.7x:

```
Error: LangGraphAgent import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead
```

#6617 converted only the App Router tab. So the file is simultaneously
invisible to readers and wrong.

## Why delete rather than patch

The live LangGraph quickstart already documents the endpoint with the
correct import
(`showcase/shell-docs/src/content/docs/integrations/langgraph/quickstart.mdx:371`).
Patching four tabs of a file that ships to nobody adds a maintenance
surface without adding a reader.

## Testing

Deletion only — no code changes. Verified by four independent lenses,
each of which came back empty for this file:

| Lens | Result |
|---|---|
| MDX imports of
`@/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx` | none
|
| `mdx-registry.tsx` / `docs-render.tsx` stub maps | absent |
| Directory enumeration of `src/content/snippets` | no such mechanism
exists |
| Repo-wide `grep -F` for the basename | none |

I did not build shell-docs locally; the branch's shell-docs CI jobs are
the check that matters for a content deletion, and a reference that all
four lenses missed would surface there.

## Note, not addressed here

While scoping this I ran two different orphan sweeps over all 98
snippets and they disagreed sharply (19 vs 42 candidates) —
path-matching over-reports because it misses registry entries,
basename-matching under-reports because distinct files share a basename.
A real answer needs a resolver that follows both mechanisms. That is
worth doing, and it is not this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Removed the self-hosting guide for configuring Copilot Runtime
LangGraph endpoints.
- The guide previously covered setup examples for Next.js, Node.js,
Express, and NestJS.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
NathanTarbert pushed a commit to vvlrff/CopilotKit that referenced this pull request Sep 14, 2026
`snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx` reaches no
reader. It is referenced by neither of the two mechanisms shell-docs uses:
no MDX file imports `@/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx`,
and it appears in neither `mdx-registry.tsx` nor `docs-render.tsx`. Its
importer was the retired docs app, deleted in 33a7948.

It is also stale. Four of its five tabs still show `LangGraphAgent` imported
from the `@copilotkit/runtime` root, whose constructor throws on any version
>= 1.7x; CopilotKit#6617 converted only the App Router tab. The live LangGraph
quickstart already documents the correct `@copilotkit/runtime/langgraph`
import, so nothing is lost by removing the file rather than patching content
that ships to nobody.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants