Commit Graph

5145 Commits

Author SHA1 Message Date
copilotkit-qa-bot[bot] 17c59fd719 collect Agno persistence regression in CI 2026-08-26 14:56:06 -07:00
copilotkit-qa-bot[bot] 301fa3cc19 Merge remote-tracking branch 'origin/main' into codex/fac-125-agno-db-docs 2026-08-26 14:47:03 -07:00
copilotkit-qa-bot[bot] 235ac1cf8f fix(docs): correct Intelligence CTA redirects 2026-08-26 14:01:28 -07:00
github-actions[bot] 53b2bfb520 style: auto-fix formatting 2026-08-26 20:46:46 +00:00
copilotkit-qa-bot[bot] 09f0482152 document Agno frontend-tool session storage 2026-08-26 13:43:11 -07:00
copilotkit-qa-bot[bot] 70f15d6ead Merge remote-tracking branch 'origin/main' into codex/fac-127-ms-agent-stable-apis 2026-08-26 12:56:16 -07:00
copilotkit-qa-bot[bot] 0b854047e2 fix(ms-agent-python): preserve Azure AD auth 2026-08-26 12:55:46 -07:00
copilotkit-qa-bot[bot] b0908711ab Merge remote-tracking branch 'origin/main' into codex/fac-72-google-adk-stop-callback 2026-08-26 12:30:08 -07:00
copilotkit-qa-bot[bot] 2ba50f1476 docs(google-adk): keep callback setup concise 2026-08-26 12:29:46 -07:00
Maxim f8e13e675c Remove the banking showcase in favor of reskinnable-demo (#6683)
## What

Sunsets `examples/showcases/banking`. It is superseded by
`examples/showcases/reskinnable-demo`, which ships the same banking
experience as one of its runtime-swappable skins (alongside airline) on
top of a shared shell. Keeping both means maintaining two copies of the
same demo.

160 files deleted, plus the five places that pointed at the app:

| File | Change |
| --- | --- |
| `pnpm-workspace.yaml` | Drops the workspace entry. Also fixes the
adjacent NOTE, which attributed the canary AG-UI pin to "banking's
agent" when it is reskinnable-demo's own Python deep agent that needs
it. |
| `pnpm-lock.yaml` | Regenerated (−919/+12). The 12 additions are
peer-suffix re-keying caused by removing the importer — banking pinned a
different `eslint`/`vitest` peer combination. No dependency version
changes. |
| `examples/README.md` | The banking row becomes a reskinnable-demo row,
so the successor is listed and the showcase count is unchanged. |
| `showcase/shell-docs/src/content/docs/faq.mdx` | The "Banking
Assistant" link retargets to reskinnable-demo instead of 404ing. |
| `.github/config-allowlist.txt` | Drops the deleted `next.config.mjs`.
|

Note that banking was a real pnpm workspace member using `workspace:*`
deps, unlike reskinnable-demo, which sits deliberately outside the
workspace with its own lockfile. That is why the root lockfile has to be
regenerated here.

## Deliberately not changed

- `scripts/migrate-demos.sh` and `scripts/archive-demo-repos.sh` still
name `examples/showcases/banking`. Those are the already-executed
one-shot manifests for the repo consolidation; the path is a historical
record in them, not a live reference.
- `reskinnable-demo`'s `.env.example` and `docker-compose.yml` still
explain their +200 port offset in terms of banking's stack. The offset
stays real, and "was cloned from banking" stays true.
- The `banking` mentions in `test_reskinnable-demo.yml` refer to
reskinnable-demo's **banking skin**, not this app.

## Verification

- `.github/scripts/check-config-allowlist.sh` passes.
- A full `pnpm install` agrees with the regenerated lockfile (no further
diff).
- The lockfile-only regen and the full install produce identical output.

The `test-and-check-packages` pre-commit hook fires on any
`pnpm-lock.yaml` change, so it ran `test,publint,attw` across all 25
packages. Four suites failed locally — `sqlite-runner`, `web-inspector`,
`vue`, `react-core` — in a worktree installed with `--ignore-scripts`,
which skips `better-sqlite3`'s native build. This change touches no
package source, so CI is the gate on those; please confirm they are
green here before merging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-08-26 21:27:16 +02:00
copilotkit-qa-bot[bot] 7a24a2d855 fix(ms-agent-python): migrate starter to stable APIs 2026-08-26 12:09:08 -07:00
copilotkit-qa-bot[bot] 1ddc8d5454 Merge remote-tracking branch 'origin/main' into codex/fac-72-google-adk-stop-callback 2026-08-26 11:11:28 -07:00
Tyler Slaton b3b339f544 Revert "feat(web-inspector): add Event Snippets and save-as-snippet (#6649)"
This reverts commit ba4260ad66, reversing
changes made to 47c5510b49.
2026-08-26 02:11:19 +02:00
Ben Taylor f2390df714 docs: fix typo in Mastra shared state guide (#6686)
## What does this PR do?

Corrects `faciliate` to `facilitate` in the Mastra shared state
documentation.

## Related PRs and Issues

- None.

## Validation

- `codespell
showcase/shell-docs/src/content/docs/integrations/mastra/shared-state/index.mdx`
- `git diff --check`

## Checklist

- [x] I have read the [Contribution
Guide](https://github.com/CopilotKit/CopilotKit/blob/main/CONTRIBUTING.md).
- [x] The relevant documentation is updated by this PR.
- [x] "Allow edits by maintainers" is enabled.
2026-08-25 12:32:26 -05:00
Ben Taylor 4319370f7e docs(react-native): say how to prove the integration without a browser (#6685)
## Why

The React Native page covers building the integration thoroughly and
never says how to
establish that it **works**. `verify` appeared zero times in its 646
lines, and the only
verification content was a reactive troubleshooting entry ("no response
from the runtime →
check `/info`").

That gap is sharper here than on the web frontends. There, "open it and
look" is an
unstated fallback that genuinely works. On React Native there is no
browser, so a reader
who follows this page to the end has no proof step at all — and the
obvious substitutes
each prove less than they appear to.

## What this adds

A **Proving it works** section with three checks, explicit that none is
sufficient alone:

1. **`copilotkit verify --round-trip`** — proves an agent answered, with
no browser and no
device. Its limits are stated rather than left to be discovered: it
sends a *fixed*
prompt and records the answer's length, never its text, so it cannot
tell you what came
back; and it proves an agent answered under the declared id, not *which*
deployment
   answered.
2. **A device capture** — `adb exec-out screencap -p`, plus `adb logcat`
for an unresolved
redbox. iOS has no `adb` equivalent short of full Xcode, and the Command
Line Tools do
   not ship `simctl`, so the section says so instead of implying parity.
3. **Checking the answer against the records the app holds** — the only
step that separates
a correct answer from a fluent one about records that do not exist. That
failure is
invisible in a screenshot, in a video, and to any reviewer unfamiliar
with the data.

Two smaller fixes on the same page:

- **`useAgentContext` is now a callout, not a list entry.** It sat in
the shared-hooks list
described as behaving "the same as on the web", which undersells the one
hook whose
absence fails *silently*. Rendering a list puts it in the view tree, not
in the agent's
context — separate steps. An agent missing the second still answers
plausibly, the tool UI
paints, and nothing errors. React Native has no browser console to
notice it in.
- **`@react-native-community/cli` is now a prerequisite.** React Native
0.87 no longer
bundles it, so an *upgraded* app needs it in `devDependencies` or
`react-native bundle`
and `react-native start` refuse to run. A freshly `init`ed app already
has it, which is
  why the quickstart path never surfaced this.

## Notes for review

- **Docs-only.** One `.mdx` file, +78 lines, no code or config touched.
- The three anchor links used (`#connecting-from-a-device-or-bench`,
`#which-hooks-are-shared-and-which-arent`, `#known-limitations`) all
resolve to existing
  headings, and match the anchor style the page already uses elsewhere.
- Prose is unwrapped to single-line paragraphs and callout bodies are
2-space indented, to
  match the file's existing convention.
- `npm run lint` in `docs/` exits 0 with no new warnings. `vitest run`
gives 188 passed / 29
failed-to-load — **identical to a pristine `origin/main` worktree**,
which I ran to confirm;
  those failures are a local module-resolution issue, not this change.
- Deliberately **not** included: documenting `copilotkit verify`
generally. It is currently
undocumented across the whole docs tree (Angular and Vue score zero on
"verif" too), which
wants its own change and probably a shared page rather than a
per-frontend section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-08-25 10:35:51 -05:00
Ben Taylor a2e5abb0e6 Make React SPA a supported onboarding path (docs half) (#6675)
Closes the docs half of OSS-938. The Intelligence half (graph node flip,
`frontend/plan.md`, fixture conversion, replacement unsupported cell)
lands as a separate PR in `CopilotKit/Intelligence` — it cannot share a
PR across the repo boundary.

## Why

React SPA was the only frontend the onboarding graph could not route to
a validated outcome, and the gap was exactly one step: **where Copilot
Runtime lives.** Every framework quickstart hosts the runtime in a
Next.js route handler and sets a relative
`runtimeUrl="/api/copilotkit"`. That path resolves only because Next.js
serves the app and the runtime from one origin. A Vite or CRA app has
neither a server nor a shared origin, so the instruction had nowhere to
land.

The rest of the React tree already works unchanged in a SPA —
`/frontend-tools`, `/generative-ui`, `/human-in-the-loop`, `/headless`,
`/prebuilt-components` and `/reference/v2` contain no Next.js-specific
steps. So this adds one page for the one difference and links out for
everything else, rather than forking a parallel React tree.

## What's here

**1. `docs/frontends/react-spa.mdx`** — the standalone Node runtime
server (the `angular.mdx` / `vue.mdx` shape), the absolute `runtimeUrl`
it requires, `cors: true`, the two-dev-server port story, and links back
out to the root React pages.

**2. `react-spa` registered in
`showcase/shared/frontend-registry.json`** — required, not cosmetic.
Frontend route resolution is gated on `isFrontendId`
(`src/app/[framework]/[[...slug]]/page.tsx:96`, and the `/frontends/x` →
`/x` flattening at line 133), and `isFrontendId` reads the registry. An
unregistered MDX file 404s. Vue and React Native are the precedent —
both registered, both a single page, neither with a namespaced subtree —
so this does **not** create the `/react-spa/**` mirror tree OSS-938
rules out. `feature_support_required: false` matches them, so no
feature-support matrix entries are needed.

**3. The `runtimeUrl` sweep — 13 quickstarts**, each getting a callout
on its provider step noting that the relative path assumes a
Next.js-served origin.

## Two things worth a reviewer's attention

**`cors: true` is load-bearing and easy to omit.** `resolveCorsConfig`
(`packages/runtime/src/v2/runtime/core/fetch-handler.ts:784`) is `if
(!cors) return null`, and `createCopilotNodeListener` passes options
straight through to `createCopilotRuntimeHandler`. So CORS is **off by
default** on exactly the adapter a standalone SPA runtime uses — while
Express (`endpoints/express.ts:126`, `cors: corsOption = true`) and Hono
(`endpoints/hono.ts:105`) default permissive. Since the SPA's app and
runtime are on different origins, omitting it fails every request on
preflight. The page calls this out twice.

**The sweep callouts deliberately contain no root-relative links.** My
first attempt linked `/react-spa`, `/vue` and `/react-native`, which
broke `angular-docs-content.test.ts` → "keeps every rendered
backend-specific Angular link in context" with 45 leaks. That test is
right and the links were wrong: `resolveAngularDoc` falls back to
`frameworkContentSlug`, so the Angular surface **reuses these same
integration quickstarts**, and its link contract deliberately keeps
readers inside `/angular/**`. Enumerating three other frontends was also
wrong content for an Angular reader. The callout now names the guide
paths as inline code instead.

The cost is that the sweep no longer hands the reader a clickable link —
discoverability for React SPA comes from the frontend selector entry
instead. Doing both properly needs a frontend-conditional content
component (the `WhenAngularBackend` pattern, but keyed on frontend),
which is more than this sub-task should carry. Worth a follow-up.

## Corrections to the issue found while implementing

- **There is no doctest harness.** OSS-938 says the snippets are
doctest-gated. `shell-docs` runs vitest over `src/**/*.test.{ts,tsx}`
only — MDX code blocks are never executed. The real gates are that suite
plus `tsc --noEmit`.
- **The docs do have a frontend selector**, backed by the registry (6
entries before this change). The issue's "no frontend selector anywhere"
is true only of MDX *tab groups*.
- **The sweep is 13 source files, not 18 pages.** The langgraph,
microsoft-agent-framework and aws-strands variants are tab groups inside
one page each, so `langgraph-fastapi`/`-python`/`-typescript` collapse
to one file, the three `ms-agent-*` to one, and
`strands`/`strands-typescript` to one.
- **The root `/quickstart` needs nothing.** It is a 17-line routing shim
that 308-redirects to `/` and carries no runtime step at all. The issue
counts it among the 18.
- **The issue's page list misses `built-in-agent` and the root-level
`agent-spec/quickstart.mdx`**, both of which do carry the relative
`runtimeUrl`. Both are swept here.
- **Vue and React Native are already done**, in both repos — both ship
the absolute-`runtimeUrl` recipe and both already route to
`credentials/finalize-plan`. The issue defers them as out of scope, but
that also means the sweep fixes the mis-route for one frontend, not
three.

## Testing

Run in the worktree against `origin/main` (`0943c5196e`).

**`tsc --noEmit` — no new errors.** Baselined by setting my changes
aside on a pristine checkout: 8 pre-existing errors, all from
`@clerk/nextjs` / `@testing-library/react` / `jsdom` being undeclared
and uninstalled in `showcase/shell-docs/package.json` (verified absent
in `main` too, so this is repo state, not this branch). With the changes
applied: the same 8, zero added.

The type widening surfaced one real error, now fixed —
`FRONTEND_REFERENCE_SLUGS` in `frontend-page-content.ts` is `satisfies
Record<FrontendPageId, string>` and needed a `react-spa` entry. It maps
to `"reference"`, the root React reference, same as Vue.

**Test suite — no new failures.**

```
$ npx vitest run src/lib src/app
 Test Files  1 failed | 41 passed (42)
      Tests  1 failed | 380 passed (381)
   × renders one dependency-complete canonical tool-rendering example for mastra
```

That mastra failure is pre-existing — reproduced on a pristine
`origin/main` checkout with every change of mine removed:

```
$ git checkout -- <changed files> && mv react-spa.mdx aside
$ npx vitest run src/lib/__tests__/llm-text.test.ts
      Tests  1 failed | 39 passed (40)
   × renders one dependency-complete canonical tool-rendering example for mastra
```

**The new page is covered by an existing registry-driven guard, and the
coverage is real.** `frontend-options.test.ts` → "maps every non-React
frontend to an MDX guide page" iterates `FRONTEND_PAGE_IDS` and asserts
`loadDoc(getFrontendContentSlug(id))?.fm.title`. Mutation-checked rather
than assumed — removing the page fails it, restoring it passes:

```
$ mv src/content/docs/frontends/react-spa.mdx /tmp/ && npx vitest run frontend-options.test.ts
   × maps every non-React frontend to an MDX guide page
      Tests  1 failed | 21 passed (22)
$ mv /tmp/react-spa.mdx src/content/docs/frontends/ && npx vitest run frontend-options.test.ts
      Tests  22 passed (22)
```

**Sweep coverage checked programmatically, not by eye.** For each of the
13 files, asserted exactly one `runtimeUrl="/api/copilotkit"`
occurrence, the callout inserted immediately after that code block's
closing fence, and the `runtimeUrl` line exactly 9 lines above it. Then
re-derived the target set from the tree to confirm nothing was missed —
the only quickstart still carrying an un-annotated relative `runtimeUrl`
is `aws-strands`, which is excluded on purpose.

**Route wiring confirmed live.** `GET /frontends/react-spa` → `301` on
the local dev server, which is the registry-gated flattening redirect
firing for a registered id. Full HTML render could not be verified
locally: the dev server 500s on `@clerk/nextjs` for *every* page
(`/vue.md` fails identically), because that dep is undeclared and
uninstalled — pre-existing and not specific to this branch.

**Every outbound link on the new page resolves** — probed
`/frontend-tools`, `/generative-ui`, `/human-in-the-loop`, `/headless`,
`/prebuilt-components`, `/reference/v2`, `/model-selection`,
`/backend/runtime-endpoints`: all 200 or 301-to-canonical.

**Fixed a stale mock while here.**
`src/app/llms-mdx/[[...slug]]/route.test.ts` hard-codes the frontend
list instead of reading the registry, so it silently omitted
`react-spa`. Added it to both lists; suite passes (15/15). The
hard-coding is still a latent divergence worth a follow-up.

## Not done here

- **`aws-strands/quickstart.mdx` is excluded from the sweep**, per the
standing hands-off arrangement while Mark leads the Strands
rejuvenation. That leaves `strands` and `strands-typescript` carrying
the un-annotated Next.js step.
- **A clickable cross-link in the sweep callouts**, per the
Angular-contract finding above.
- The Intelligence-side changes, as noted at the top.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-08-25 10:35:35 -05:00
Mike Ryan 21871d8829 docs(mastra): document the remote-agent path and lead with it for existing services (#6663)
## What

`MastraAgent.getRemoteAgents` appeared **nowhere** in this repo — not in
shell-docs, not in an example, not in a snippet. The only wiring the
Mastra docs taught was `getLocalAgents({ mastra })` behind `import {
mastra } from "@/mastra"`.

That was on the **"Use an existing agent"** branch of the quickstart —
the branch for readers who already have a Mastra service. Two steps
earlier the same branch tells you to `npx create-next-app
my-copilot-app`, a *separate* directory. `@/mastra` cannot resolve
across that boundary, and the shape it teaches moves a running Mastra
service into the frontend, deleting the process the reader was trying to
preserve.

All four cells of the 2026-08-21 Mastra × Next.js sweep reached the
agent over HTTP, and all four derived how on their own. `both` filed
"the remote-Mastra API is entirely undocumented" as its largest
friction; `empty` filed it as its worst papercut at ~10 minutes.

## Changes

**`mastra/quickstart.mdx`** (existing-agent branch)
- Route wired with `getRemoteAgents` over a `MastraClient`, so the agent
keeps running as its own process. Passed as a **factory**, so the agent
list is fetched per request — see the note below on why the promise form
is unsafe.
- `MASTRA_BASE_URL` convention, as `.env.local` in the frontend beside
the route that reads it: `process.env.MASTRA_BASE_URL ??
"http://127.0.0.1:4111"`.
- A **"Start your agent"** step, which the branch never had. Its
liveness check is `/api/agents`, not `GET /` — Mastra serves its console
on the agent port and answers 200 whether or not an agent is registered
(straight from the `empty` cell's evidence).
- A warning that `next dev` rewrites the `tsconfig.json` at its own root
— forcing `esModuleInterop`, `isolatedModules`, `resolveJsonModule` and
`jsx`, setting `noEmit: true`, and replacing `include`/`exclude`.
`noEmit` is the sharp one for an agent project that compiles with `tsc`.
A sibling package is why this path goes over HTTP. `agent-only` derived
this independently.

**`mastra/copilot-runtime.mdx`** — a new **"Local vs remote agents"**
section that decides between the two by *where the agent runs*, not by
preference, plus:
- the full `GetRemoteAgentsOptions` contract (`mastraClient`,
`resourceId`, `observationalMemory`, `tracingOptions`);
- why the factory form is the one to use — `agents` does accept the
promise itself, but that starts the HTTP call at module load with
nothing awaiting it, so an agent server that is not up yet produces an
unhandled rejection and **Node terminates the process**. The factory has
no such window: a failure is a 500 and the next request retries, so a
route that started first recovers on its own. Cost is one `listAgents()`
per request;
- the local-only options (`requestContext`, `untilIdle`) — so a run that
needs background tasks has to be embedded.

**CI gating** — the new route fence carries `doctest="component"` with a
mastra `doctest.json`. The old fence could never have been gated:
`@/mastra` does not resolve. Mastra now has its first typechecked route
snippet, 21 gated fences → 22.

## Verified

```
shipped fence, agent down -> up  -> 500, then 200; process survived, no restart needed
promise form, agent down         -> node terminated on an unhandled rejection
next build, NodeNext tsconfig    -> 13 keys written; module/moduleResolution NOT touched
mastra CLI                       -> serverPort 4111, getPort over 4111..4131, apiPrefix /api
doc-test extraction              -> 21 -> 22 fences; mastra sidecar selected, not the root one
extracted fence, runner config   -> tsc exit 0 (runtime 1.68.3; @ag-ui/mastra 1.1.1 and 1.1.2)
mutation: drop resourceId        -> tsc exit 1, TS2741 (the gate is live)
previously documented local shape-> tsc exit 2, resourceId missing
MDX compile, both files          -> OK (mutation-checked: unclosed tag -> FAIL)
validate-intelligence-env-names  -> exit 0
```

The behavioural checks drove the **extracted fence itself** against a
stub agent server, not a paraphrase of it — including confirming it
calls `/api/agents` (the same path the quickstart gives as the liveness
check) and that it honours `MASTRA_BASE_URL`.

The extracted fence was byte-compared against the file that typechecked
green.

**Not run:** the shell-docs vitest suite. No test reads either file,
there are no snapshots, and no page was added or moved — nav, sitemap
and `llms.txt` are unchanged. Lefthook could not run in the worktree
(`tsx: command not found`, no `node_modules`); its one non-skipped gate,
`check:intelligence-env-names`, was run manually against this tree and
passes, and the commit message passes commitlint.

## Second commit

The first commit shipped the promise form and named `moduleResolution:
"NodeNext"` as what `next dev` clobbers. Self-review caught both: the
promise form crashes the process, and `nodenext` is in Next's *accepted*
set for `module` and `moduleResolution`, so it is never rewritten.
`7f068c6` corrects both plus the `MASTRA_BASE_URL` shell, each against a
real run rather than a source read.

## Found along the way, not fixed here

`getLocalAgents({ mastra })` — no `resourceId` — **does not typecheck**
against current `@ag-ui/mastra`; `resourceId` is required in
`GetLocalAgentsOptions`. That shape still ships on four other pages
(`shared-state/` ×3, `background-tasks.mdx`), and
`examples/integrations/mastra/src/agent.ts` carries a `//
@ts-expect-error - ignore for now, typing error` over exactly this call.
Left alone to keep this PR focused; happy to file it or fix it in a
follow-up.

Refs OSS-925.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-08-25 08:22:17 -07:00
Ben Taylor 37d3616959 Merge branch 'main' into ben1/oss-938-react-spa-supported-path 2026-08-25 09:21:19 -05:00
Mark 4bfcb5ce2c fix(showcase): make harness worker recycling durable (#6664)
## Summary

- make planned max-job harness-worker recycling exit cleanly after
ordered teardown, while escaped teardown failures still exit non-zero
- declare Railway `ALWAYS` as the staging and production
`harness-workers` restart policy in the existing service source of truth
- apply and verify the worker policy in the existing staging redeploy
and production promotion paths
- preserve the policy for direct named `harness-workers` pins and block
direct worker rollback with safer pin guidance

## Operational contract

- Railway remains the only worker supervisor; this does not add an
in-process restart manager
- staging worker update/readback failures are release-blocking for that
target, while independent staging services continue
- production promotion verifies the exact newly-created deployment ID,
serving digest, and active restart policy before reporting success
- no retry-max field is managed, and this does not claim unlimited
restarts for pathological crash loops
- generic restore, generic non-worker pin, and generic production
redeploy behavior are intentionally unchanged

## Review fixes

- require production promotion readback to match the deployment ID just
created
- preserve SSOT restart policy and replica settings on direct named
worker pin
- narrow the runbook language to the direct named worker pin path
actually covered by the implementation

## Verification

- `@copilotkit/showcase-scripts`: 78 test files / 2,539 tests passed
- `@copilotkit/showcase-harness`: 177 test files passed / 2 skipped;
3,723 tests passed / 18 skipped
- Ruby 3.3 Railway suite: 195 runs / 782 assertions / 0 failures
- formatter, explicit Nx typecheck, affected Nx build, and `git diff
--check` passed
- Tier-3 CR loop converged with zero mandatory findings after two
confirmation rounds

## Post-merge validation

Observe one unchanged staging worker identity through more than ten
ordinary recycle/restart cycles, confirm it continues claiming work, and
confirm the active deployment remains `SUCCESS` with `restartPolicyType:
ALWAYS`. This is bounded staging evidence, not an infinite-restart
guarantee.
2026-08-25 07:06:56 -07:00
Sun Han Bing 4990c8027b docs: fix typo in Mastra shared state guide 2026-08-25 21:49:07 +08:00
Benjamin Taylor 2ee4d6bc6b Merge branch 'main' into ben1/oss-925-the-remote-mastra-path-is-undocumented-and-all-four-cells
Resolves the Mastra quickstart runtime step, where this branch's remote-agent
wiring and main's Intelligence wiring landed on the same lines. Kept both: the
per-request `getRemoteAgents` factory now sits alongside `intelligence` and
`identifyUser`, `runner: new InMemoryAgentRunner()` is gone (main dropped it
with the runner), and `resourceId` is derived from the same request header as
`identifyUser` rather than left hardcoded to "user-1", which would have scoped
Mastra's memory and CopilotKit's threads to different users. Both env blocks
and both callouts are preserved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 08:29:48 -05:00
Tyler Slaton c61f0f32ed feat(web-inspector): surface failures on the launcher and open the Inspector on them (#6646) 2026-08-25 06:28:17 -07:00
Benjamin Taylor 06fe1d8232 docs(react-native): say how to prove the integration without a browser
The page tells you how to build the integration and never how to establish that it
works. `verify` appeared zero times in 646 lines, and the only verification content
was a reactive troubleshooting entry. That gap is sharper here than on the web
frontends: there, "open it and look" is an unstated fallback that actually works. On
React Native there is no browser, so a reader following this page to the end has no
proof step at all.

Adds a "Proving it works" section with three checks, and is explicit that none of them
is sufficient alone, because each one looks more conclusive than it is:

- `copilotkit verify --round-trip` proves an agent answered with no browser and no
  device. It sends a fixed prompt and records the answer's length, never its text, so
  it cannot tell you what came back -- and it proves an agent answered under the
  declared id, not which deployment answered.
- A device capture proves the tool UI rendered. Android gets `adb exec-out screencap`;
  iOS has no equivalent short of full Xcode, and the Command Line Tools do not ship
  `simctl`, so that is stated rather than left to be discovered.
- Checking the answer against the records the app holds is the only step that
  separates a correct answer from a fluent one about records that do not exist. That
  failure is invisible in a screenshot, in a video, and to any reviewer unfamiliar
  with the data.

Also on this page:

- `useAgentContext` was listed in the shared-hooks list as behaving "the same as on
  the web", which undersells the one whose absence fails silently. Rendering a list
  puts it in the view tree, not in the agent's context. An agent missing it still
  answers plausibly and nothing errors -- and React Native has no browser console to
  notice it in. Now a callout.
- React Native 0.87 no longer bundles `@react-native-community/cli`, so an upgraded
  app needs it in devDependencies or `bundle` and `start` refuse to run. A freshly
  `init`ed app already has it, which is why the quickstart path never hit this. Now a
  prerequisite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 08:27:30 -05:00
Alem Tuzlak 5391c4886b feat(web-inspector): add view thread in your app (#6562)
## What does this PR do?

Lets a developer open a saved Inspector thread in the live official
chat.

- New header action: **View in your app**
- Official React and Vue chat switch to that thread
- A pinned `threadId` does not block the switch
- **Stop viewing** or an app thread change restores the previous thread
- Example threads have no action
- Production builds hide the action
- Same agent only. No matching official chat shows an error in the
Inspector

Core owns a two-way EventClient bridge
(`@tanstack/devtools-event-client`). The root import is a no-op in
production.

Docs: Inspector guide, section **View a thread in your app**.

## Related PRs and Issues

-
https://linear.app/copilotkit/issue/OSS-871/new-features-add-a-new-view-thread-in-your-app-feature

## Checklist

- [x] I have read the Contribution Guide
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [x] Allow edits by maintainers is checked
2026-08-25 13:52:52 +02:00
Maxim e3dafff825 chore(examples): remove banking showcase in favor of reskinnable-demo
The banking showcase is superseded by `examples/showcases/reskinnable-demo`,
which ships the same banking experience as one of its runtime-swappable skins
(alongside airline) on top of a shared shell. Keeping both means maintaining
two copies of the same demo, so banking is sunset here.

Removes the app and the things that referenced it:

- `pnpm-workspace.yaml` — drops the workspace entry. Also fixes the adjacent
  NOTE, which attributed the canary AG-UI pin to "banking's agent" when it is
  reskinnable-demo's own Python deep agent that needs it.
- `pnpm-lock.yaml` — regenerated. Only the removed importer and the peer-suffix
  re-keying it caused; no dependency version changes.
- `examples/README.md` — the banking row becomes a reskinnable-demo row, so the
  successor is listed and the showcase count is unchanged.
- `showcase/shell-docs/.../faq.mdx` — the Banking Assistant link retargets to
  reskinnable-demo instead of 404ing.
- `.github/config-allowlist.txt` — drops the deleted `next.config.mjs`.

Not changed: `scripts/migrate-demos.sh` and `scripts/archive-demo-repos.sh`
still name `examples/showcases/banking`. Those are the already-executed one-shot
manifests for the repo consolidation; the path is a historical record there, not
a live reference. reskinnable-demo's `.env.example` and `docker-compose.yml`
likewise still explain their +200 port offset in terms of banking's stack — the
offset stays real, and "was cloned from banking" stays true.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 12:11:48 +02:00
Lukas Moschitz 306ddaa5df Merge remote-tracking branch 'origin/main' into lukas/oss-903-presentation-wire-errors-notifications-to-emanate-from-and
# Conflicts:
#	packages/web-inspector/src/lib/__tests__/telemetry.test.ts
#	packages/web-inspector/src/styles/generated.css
2026-08-25 12:09:52 +02:00
Alem Tuzlak 8c12aba792 chore: remove merge-only import formatting 2026-08-25 11:28:41 +02:00
Lukas Moschitz 10d7820170 docs(inspector): only promise the highlights the code can deliver
Three claims the code refuses, and one source missing.

- "The failed tool call is highlighted" covered both tool cases, but
  `TOOL_NOT_FOUND` is emitted with `toolName` and `agentId` and no
  `toolCallId` -- a tool that was never found has no call to point at.
- "The failed `RUN_ERROR` event is highlighted" holds only when such an
  event is in the buffer; several codes reach the run source without one.
- "A red launcher pill names the failure. Click it" reads as unconditional,
  but the pill is suppressed where there is no room beside the launcher,
  leaving a red dot and nothing to click.
- Learning is the fifth source and appeared in neither page. Documented
  with the constraint that makes it different: the memory store is created
  on first visit, so nothing is reported before that.
2026-08-25 11:27:05 +02:00
Tyler Slaton 72fcd1dabd docs(langgraph): fix inaccurate "Works the same for create_react_agent" comments (7 sites) (#6614)
Closes #6607.

Verified against the pinned `langgraph_prebuilt` (1.1.0):
`create_react_agent` has neither `middleware` nor `system_prompt`
parameters, rejects `state_schema=CopilotKitState`, and is deprecated in
favour of `langchain.agents.create_agent`. Readers following the comment
hit an immediate `TypeError`.

All 7 occurrences on `main` are updated (4 sites noted in the issue plus
the 3 that landed with #5469):

-
`showcase/shell-docs/src/content/docs/integrations/langgraph/agent-app-context.mdx`
(Python + TypeScript)
-
`showcase/shell-docs/src/content/docs/integrations/langgraph/frontend-tools.mdx`
(Python + TypeScript)
-
`showcase/shell-docs/src/content/snippets/integrations/langgraph/frontend-tools.mdx`
(Python + TypeScript)
- `showcase/shell-docs/src/content/reference/hooks/useFrontendTool.mdx`
(Python)

Each comment is replaced with an accurate note (”`create_agent`
supersedes the deprecated `create_react_agent`, which accepts neither
`middleware=` nor `system_prompt=`”), and the TypeScript snippets now
reference `createReactAgent` (camelCase) instead of the Python
`create_react_agent` name — the second, smaller problem noted in the
issue.
2026-08-25 01:55:52 -07:00
Alem Tuzlak ba4260ad66 feat(web-inspector): add Event Snippets and save-as-snippet (#6649)
Open Inspector Event Snippets on localhost. You can compile, save, and
replay AG-UI events in chat. Chat shows a bookmark icon next to a tool
call, an A2UI block, or generative UI. Click the icon to save that turn
as a snippet.

## What does this PR do?

This PR adds the Inspector Event Snippets pane.

You can:

- Compile a snippet from a recipe (tool-call, reasoning, text, activity,
raw)
- Save snippets in origin-scoped localStorage
(`cpk:inspector:event-snippets`)
- Import and export snippets from the pane header
- Replay a snippet into live chat through Inspector-only Core inject

Each Run remints `messageId`, `parentMessageId`, `toolCallId`, and
`runId`. The second Run of the same snippet is a new turn.

On localhost, chat shows a bookmark icon beside a tool call, A2UI block,
or generative UI. The icon is absolutely positioned. It hangs to the
right when there is room. Otherwise it hangs to the left. The card stays
full chat width.

The React demo adds `sayHello`, `getTime`, `addNumbers`, and a **Call 3
tools** suggestion.

## Related PRs and Issues

- Linear
[OSS-874](https://linear.app/copilotkit/issue/OSS-874/new-features-also-allow-users-to-emit-specific-events-from-the)

## Checklist

- [x] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [x] "Allow edits by maintainers" is checked (lets us help iterate on
your PR directly — faster turnaround for everyone)

## Testing

### Commands run

1. Lefthook pre-commit ran `nx` targets `test`, `publint`, and `attw`
for 27 affected projects. All passed.
2. I did not run `pnpm test:pr` (full repo). Lefthook ran the affected
package matrix only.

### Manual test

1. Run `pnpm demo:react` from the repo root.
2. Open http://localhost:3000
3. Open Inspector and select Event Snippets.
4. In chat, click **Call 3 tools**. Confirm three tool cards at full
chat width, with the bookmark hanging outside the card.
5. Click a bookmark, then click Run twice. Chat shows a second turn with
new IDs.

### How this PR makes testing easy

- `packages/web-inspector/src/lib/__tests__/event-snippets.test.ts`
- `packages/core/src/__tests__/inspect-inject.test.ts` (covers two
injects)
- React demo: `examples/v2/react/demo/src/app/page.tsx`

## Linked issues

Linear
[OSS-874](https://linear.app/copilotkit/issue/OSS-874/new-features-also-allow-users-to-emit-specific-events-from-the)

## Risk / rollback

- If ID remint is wrong, a second Run can no-op or duplicate a turn.
- The save icon shows on localhost Inspector (or when `showDevConsole`
is `true`).
- Rollback: revert this PR.

## Public API change

**Before**

Angular has no Inspector service.

```ts
// no CopilotInspector export from @copilotkit/angular
```

**After**

```ts
import { CopilotInspector } from "@copilotkit/angular";

const inspector = inject(CopilotInspector);
inspector.openInspector({
  messageId: "msg-1",
  menu: "event-snippets",
});
```

React and Vue apps that already mount Inspector on localhost need no new
caller code. Chat wires the bookmark through Inspector context.

`@copilotkit/core` exports `ɵinjectInspectorEvents` for Inspector only.
App code must not call it. There is no public Core emit API.
2026-08-25 09:39:37 +02:00
Mark 198b226d94 docs(showcase): narrow worker pin policy note 2026-08-24 20:59:28 -07:00
Mark e90a3dd938 fix(showcase): preserve worker policy on railway pin 2026-08-24 19:36:04 -07:00
Mark c56f1d8a43 fix(showcase): verify promoted deployment id before success 2026-08-24 19:36:03 -07:00
Mark c5a0f36efc docs(showcase): document durable worker recycling 2026-08-24 18:00:10 -07:00
Mark a2344ece7f fix(showcase): enforce worker policy in production operations 2026-08-24 17:59:55 -07:00
Mark 92d3de79fb fix(showcase): recycle harness workers with clean exits 2026-08-24 17:59:41 -07:00
Mark 1351fa63d2 fix(showcase): apply durable worker policy in staging 2026-08-24 17:59:22 -07:00
Alem Tuzlak 328ee3cb58 Merge origin/main into feat/OSS-871-view-thread-in-app 2026-08-24 19:58:19 +02:00
Benjamin Taylor 11895f77d1 flag the Next.js-served origin the quickstarts' relative runtimeUrl assumes
Every framework quickstart sets runtimeUrl="/api/copilotkit". That resolves
only because Next.js serves the app and the runtime from one origin, and
nothing on the page said so -- so a reader on a client-only frontend followed
a step that could not work for them.

Annotate the provider step in all 13 quickstarts that carry it, pointing at
the per-frontend guides that show a standalone runtime server and an absolute
runtimeUrl.

The callout deliberately uses no root-relative links. The Angular surface
reuses these same integration quickstarts via resolveAngularDoc's fallback to
frameworkContentSlug, and its link contract keeps readers inside /angular/**;
linking three other frontends' pages both broke that contract and was wrong
content for an Angular reader.

aws-strands is left un-annotated while the Strands rejuvenation is underway.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 11:59:45 -05:00
Benjamin Taylor 6f3638c446 document Copilot Runtime hosting for React SPAs
A React single-page app is the one frontend the docs could not get to a
working runtime. Every framework quickstart hosts the runtime in a Next.js
route handler and uses a relative runtimeUrl of /api/copilotkit, which only
resolves because Next.js serves the app and the runtime from one origin. A
Vite or CRA app has neither a server nor a shared origin, so that step had
nowhere to land.

Add a React SPA page covering only that difference: a standalone Node runtime
server, the absolute runtimeUrl it requires, and cors: true -- which is off by
default on createCopilotNodeListener, unlike the Express and Hono adapters.
Everything else links back to the root React docs rather than restating them.

Registering react-spa in the frontend registry is what makes /react-spa
resolve; route resolution is gated on isFrontendId, so an unregistered page
404s. Vue and React Native are the precedent: registered, single-page, no
namespaced subtree. The existing registry-driven guard in frontend-options
already covers the new page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 11:52:48 -05:00
Mike Ryan e5c902aeea fix: align docs auth labels with product name 2026-08-24 09:38:15 -07:00
Mike Ryan db88826432 chore: rename Enterprise Intelligence product copy 2026-08-24 09:38:15 -07:00
Ben Taylor e8cbd61ec9 docs(integrations): wire quickstart runtimes to Intelligence (closes OSS-932) (#6671)
## What does this PR do?

Twelve integration quickstarts opened by telling the reader to create a
free account and get a license key, then — seven steps later — showed a
runtime constructed like this:

```ts
const runtime = new CopilotRuntime({
  agents: { ... },
  runner: new InMemoryAgentRunner(),
});
```

`runner` and `intelligence` are mutually exclusive by construction
(`CopilotSseRuntimeOptions` declares `intelligence?: undefined`), so the
key provisioned in step 1 could not be consumed. Threads read "locked",
and nothing on the page indicated a choice had been made. Worse, **none
of the twelve pages ever named `INTELLIGENCE_API_KEY`** — after step 1
the key was never mentioned again.

Each page now:

1. Constructs the runtime with `intelligence: new
CopilotKitIntelligence({ apiKey: process.env.INTELLIGENCE_API_KEY! })`
and `identifyUser`.
2. Names `INTELLIGENCE_API_KEY` in a `.env.local` fence at the point the
route reads it.
3. Links `/premium/connect-your-runtime` — a good page that had **zero**
inbound links from any quickstart — from a callout that also documents
the in-memory opt-out.

The in-memory runner stays available and is labelled as the opt-out. It
was already the default (`super(options, options.runner ?? new
InMemoryAgentRunner())`), so passing it explicitly only ever added the
steer.

Also adds the required `name` field to the `identifyUser` snippets in
`connect-your-runtime.mdx` and the runtime skill's `agent-runners.md`.
Both omitted it, so copying either was a type error:

```
Property 'name' is missing in type '{ id: string; }' but required in type 'CopilotRuntimeUser'
```

### Scope

Not "every page mentioning `InMemoryAgentRunner`" — that is 37 files,
and most are legitimate (`backend/agent-runner.mdx` is *about* runners;
an AgentCore host is a Lambda and cannot host the Intelligence socket at
all). The scope is **pages that provision a license key and then show a
runtime that cannot consume it**, which partitions those 37 cleanly into
12 in-scope and 25 untouched.

Note that includes `docs/agent-spec/quickstart.mdx`, which is
byte-identical to `docs/integrations/agent-spec/quickstart.mdx`. Both
are fixed here; retiring the duplication is filed separately.

## Verification

Nine of the twelve runtime fences are `doctest="component"` gated, so
they are really compiled in CI against a pinned
`@copilotkit/runtime@1.68.3`. The new constructor was proven there
before being applied to twelve files.

- Extracted the docs tree with `scripts/doc-tests/extract.ts` → 16
snippets. **All 15 `component` snippets typecheck clean**, covering 9 of
the 12 edited pages plus 6 untouched pages (so it also rules out
collateral damage).
- Confirmed the gate can go red: removing `name` from an edited snippet
reproduces exactly the error above, so the pass above is meaningful.
- The 3 ungated fences (mastra ×1, langgraph ×2) were typechecked by
hand, since CI will not.
- `src/lib/__tests__/intelligence-wiring-docs.test.ts` passes 3/3. That
suite guards this defect class, and **this change brings these pages
into its coverage for the first time — 8 → 20 pages**, because a page
only enters the suite once it actually configures `intelligence`.
- `pnpm check:intelligence-env-names` passes. `pnpm check:plugin-skills`
initially failed (`packages/runtime/skills/**` is mirrored to
`skills/**`); synced, both copies included.

## Related PRs and Issues

- Closes OSS-932
- Part of the OSS-923 split, alongside OSS-933 (runtime silently drops
`runner` alongside `intelligence`)
- OSS-935 — the byte-identical agent-spec duplication
- OSS-936 — the Mastra fence's `getLocalAgents({ mastra })` does not
compile against `@ag-ui/mastra@1.1.2`. **Pre-existing on
`origin/main`**, reproduced on the unmodified snippet, not addressed
here

Worth noting for reviewers: the Mastra runtime fence cannot be
doctest-gated as written (it imports the `@/mastra` path alias, which
does not resolve in the extracted directory), and `@ag-ui/mastra` is in
no `doctest.json`. It is the least-verified page in the set on two
independent axes, and it accumulated two unrelated defects. That may
explain why only the Mastra evaluation cell surfaced this.

## Checklist

- [x] I have read the Contribution Guide
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [x] "Allow edits by maintainers" is checked

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-08-24 10:58:34 -05:00
Benjamin Taylor deb8b5c579 Merge branch 'main' into ben1/docs-anthropic-adaptive-thinking
Resolves conflicts in the two custom-agent docs copies. Main's "docs: update
Anthropic model references to Opus 4.8" (518feae6cd) independently bumped the
Anthropic thinking snippets to `claude-sonnet-4-6` -- the same model id this
branch picked -- so the overlap was textual, not a disagreement.

Kept this branch's side in both files: it already carries that model id and
additionally moves the AI SDK options into `providerOptions.anthropic` and
switches to `{ type: "adaptive" }` with `effort`. Main's bumps on the
surrounding property-forwarding examples merge in unchanged.
2026-08-24 09:40:00 -05:00
Benjamin Taylor 59b0476e67 docs(integrations): wire quickstart runtimes to Intelligence (closes OSS-932)
Twelve quickstarts provisioned a license key in step 1 and then showed a
runtime constructed with `runner: new InMemoryAgentRunner()` — an option
that is mutually exclusive with `intelligence`, so the key was never read.
Threads showed "locked" and nothing indicated a choice had been made.

Each of those pages now constructs the runtime with `intelligence` and
`identifyUser`, names `INTELLIGENCE_API_KEY` where the route reads it, and
links /premium/connect-your-runtime — which had no inbound link from any
quickstart. The in-memory runner stays available as a labelled opt-out;
it was already the default, so passing it explicitly only added the steer.

Also adds the required `name` field to the `identifyUser` snippets in
connect-your-runtime.mdx and the runtime skill's agent-runners reference.
Both omitted it, so copying either was a type error.

Scope is every page that provisions a key and then shows a runtime that
cannot consume it. Pages that legitimately document the in-memory runner
(backend/agent-runner, deploy/agentcore) are unchanged.

Verified: all 15 doctest `component` snippets typecheck against the pinned
@copilotkit/runtime@1.68.3, and the gate goes red when `name` is removed.
2026-08-24 08:48:59 -05:00
Alem Tuzlak 4bd576d4ea Merge branch 'main' into alem/oss-874-inspector-event-snippets 2026-08-24 15:48:38 +02:00
Alem Tuzlak 0c6f52fc41 feat(examples): add crash-the-tool and crash-the-run inspector lab
Add chat phrases and lab buttons that fail a frontend tool or emit RUN_ERROR.
Clear the Break threads cookie on load so a refresh does not keep a fake
thread-list failure.
2026-08-24 15:22:07 +02:00
Benjamin Taylor 7f068c6eed docs(mastra): resolve remote agents per request, and correct two wrong claims
Self-review of the previous commit found three defects, two of them factual
errors I asserted without checking.

1. The promise form can kill the process. I documented
   `agents: MastraAgent.getRemoteAgents({ ... })` and described its failure mode
   as "the rejection is cached and every later request fails". That understated
   it: the call starts at module load with nothing awaiting it, so an agent
   server that is not up yet produces an *unhandled* rejection and Node
   terminates. Both files now lead with the factory form, which has no such
   window — nothing runs until a request arrives, a failure is a 500, and the
   next request retries.

2. The tsconfig warning named the wrong key. `next dev` does not overwrite
   `moduleResolution: "NodeNext"` — `nodenext` is in Next's accepted set for
   both `module` and `moduleResolution`. What it actually does at its own root
   is force `esModuleInterop`, `isolatedModules`, `resolveJsonModule` and `jsx`,
   set `noEmit: true`, and replace `include`/`exclude`. `noEmit` is the sharp
   one for an agent project that compiles with `tsc`. The advice stands; the
   mechanism is now the verified one.

3. `MASTRA_BASE_URL` was set in the wrong shell. It was exported in the agent's
   terminal, where the frontend cannot see it. It now appears as `.env.local` in
   the Next app, next to the route that reads it. The port note moved to the
   step that starts the agent, and says what `mastra dev` really does: 4111 when
   free, walking up to 4131 when not.

Verified:

    shipped fence, agent down -> up  -> 500, then 200; process survived, no restart
    promise form, agent down        -> node terminated on unhandled rejection
    next build, NodeNext tsconfig   -> 13 keys written; module/moduleResolution untouched
    mastra CLI                      -> serverPort 4111, getPort over 4111..4131, apiPrefix /api
    extracted fence, runner config  -> tsc exit 0; mutation (drop resourceId) -> TS2741
    MDX compile, both files         -> OK

The behavioural checks drove the extracted fence itself, not a paraphrase of it.

Refs OSS-925.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 07:49:52 -05:00
Mark 4c975dad49 feat(showcase): enable LlamaIndex attachments (#6660)
## Summary

- enable the LlamaIndex multimodal Showcase demo
- update the LlamaIndex AG-UI protocol pin and its compatible
core/OpenAI adapter pins
- register the multimodal agent and refresh the integration parity notes

## Verification

- Showcase manifest and route validation passed
- LlamaIndex integration production build passed
- container dependency check passed with core 0.14.24, llms-openai
0.7.10, and protocols-ag-ui 0.4.1
- live local OpenAI smoke passed for both image and PDF attachments

## Known harness issue

The shared D6 image assertion still expects the exact contiguous phrase
`copilotkit logo`; OpenAI returned the semantically equivalent `a logo
for CopilotKit`. The browser validation confirmed one intact image
attachment and a relevant response.
2026-08-24 00:45:24 -07:00
Ran Shemtov 6f35b26614 fix(showcase): serve the CrewAI Flows plain-assistant cells with a Flow, not a crew (#6546)
## What

Eleven demos in the `crewai-crews` showcase column (labelled **CrewAI
Flows** in the UI) were served by `add_crewai_crew_fastapi_endpoint`
through a root catch-all, not by the Flow helper. This moves them onto a
real CrewAI Flow and removes the catch-all.

Affected demos: agentic-chat, gen-ui-tool-based, prebuilt-sidebar,
prebuilt-popup, chat-slots, chat-customization-css, headless-simple,
readonly-state-agent-context, agent-config, auth, voice.

## Why

`add_crewai_crew_fastapi_endpoint` wraps the crew in `ChatWithCrewFlow`,
which composes its system message with CrewAI's `build_system_message`.
That boilerplate is unconditional: it instructs the model to introduce
itself and to steer every answer back to the crew's purpose, using a
research-report example. Because the catch-all served the scaffold
research crew, those demos answered the user's question and then offered
to research the latest AI developments.

Measured against real OpenAI on `main`, first turn:

> Hey! I'm here to help you with researching cutting-edge developments
and producing detailed, actionable reports.
> The capital of France is **Paris**. If you'd like, I can also help by
generating a **current research report** on a topic of your choice.

Second turn, arithmetic question:

> 12 × 12 = 144.
> I'm here to help with researching the latest AI developments and
producing actionable reports.

Pre-seeding a hand-written `crew_description` (the existing
`_chat_flow_helpers.preseed_system_prompt`) only retargets that tail, it
does not remove it — verified on `/mcp-apps`, which is pre-seeded and
still introduces itself and offers a diagram.

## How

- New `src/agents/chat_flow.py` holds `PromptedChatFlow`, a one-turn
Flow that owns its own prompt and forwards frontend tools.
`crewai-conversational-flows` already had this class inline; it now
imports the same file, so both columns share one prompt.
- `agent_server.py` registers it at `/chat` via
`add_crewai_flow_fastapi_endpoint`, and the root catch-all registration
is gone. An unrouted agent name now fails loudly instead of landing on
someone else's backend.
- The runtime route's default target becomes `/chat`; the
`agent-config`, `auth`, and `voice` routes point there too.
- The remaining crew endpoints (`/mcp-apps`, `/byoc-hashbrown`,
`/byoc-json-render`) are untouched — each already overrides the composed
system message explicitly.
- Comments that described the removed catch-all were corrected in both
CrewAI columns.

## Verification

Against real OpenAI on the patched backend:

- `/chat` answers `Paris.` and `12 × 12 = 144.` with no purpose-reminder
tail.
- A frontend tool still round-trips: `generate_haiku` emits
`TOOL_CALL_START` / `TOOL_CALL_ARGS` / `TOOL_CALL_END`.
- `POST /` returns 404.

Python suites: 162 passed (`crewai-crews`), 164 passed
(`crewai-conversational-flows`). New coverage in `test_chat_flow.py`
(prompt contract, no crew-chat boilerplate, tool forwarding) plus a
routing contract test asserting no cell can reach a crew endpoint by
fall-through.

D6 replay: see the checklist below.

### D6 replay (local, `--d6 --direct`, warm stack)

All fourteen green: the eleven affected cells (agentic-chat,
gen-ui-tool-based, prebuilt-sidebar, prebuilt-popup, chat-slots,
chat-customization-css, headless-simple, readonly-state-agent-context,
agent-config, auth, voice) plus tool-rendering, hitl-in-chat and
shared-state-read-write as untouched controls.

gen-ui-tool-based needed the second commit: the shared probe had both
CrewAI columns off its chart-integration list, so it sent the haiku
prompt and waited for a haiku card the page cannot draw. The probe's own
unit tests still pass (11).

The conversational column's D6 was not run — it is not deployed, and its
image was not built in this session. Its Python suite passes and its
wiring mirrors the crews column line for line.
2026-08-24 09:39:53 +02:00