Commit Graph

10887 Commits

Author SHA1 Message Date
Jordan Ritter b70fd72120 fix(examples/mastra): restore REST transport + drop stale agent prop in CopilotKit provider
The v2 migration renamed the Mastra agent key to `default` and updated
page.tsx/index.ts, but layout.tsx was missed: it still pinned
`agent="weatherAgent"` (now non-existent) and lacked
`useSingleEndpoint={false}`. The single-endpoint auto-detect races the
lazily-compiled API route, producing a 404 console error on page load
that fails the @interaction smoke leg's zero-console-error assertion.
Match the passing sibling starters (pydantic-ai/adk/ms-agent-framework-python).
2026-06-03 22:03:38 -07:00
Jordan Ritter c3142d363d feat(examples/integrations): migrate starters to CopilotKit v2 @chat on 1.59.3
Migrate adk, agno, crewai-crews, crewai-flows, mastra, pydantic-ai, ms-agent-framework-dotnet, ms-agent-framework-python, and llamaindex starters to the CopilotKit v2 `@chat` API and float them to 1.59.3 (package.json, runtime route, layout/page source, lockfiles).
2026-06-03 22:03:38 -07:00
Jordan Ritter fed4fb2040 chore(examples/integrations): float strands/langgraph starters to copilotkit 1.59.3
Version-only bump for strands-python, langgraph-fastapi, langgraph-js, and langgraph-python (package.json + lockfile); no source changes required.
2026-06-03 22:03:38 -07:00
Jordan Ritter 1e1379a225 fix(showcase/harness): make the PID/nproc ulimit actually apply under bash
The runtime CMD raised the soft nproc limit via
`/bin/sh -c "ulimit -u $(ulimit -Hu) ..."`, but on node:22-bookworm-slim
`/bin/sh` is dash, whose builtin `ulimit` does NOT support the `-u`
(max-user-processes) flag — it errors `ulimit: Illegal option -u`, which the
`2>/dev/null || true` then silently swallows. So #5185's intended PID
protection never applied; the soft limit stayed at the inherited default.

Run the CMD under `/bin/bash` (present at /usr/bin/bash) instead, whose
`ulimit -u` works. Verified against the exact base image under
`--ulimit nproc=512:4096`: bash raises the soft limit 512 -> 4096 (the hard
ceiling) while dash leaves it untouched and errors. Minimal change — only
the interpreter; the command, exec-as-PID-1, and `|| true` fallback are
unchanged.
2026-06-03 21:02:12 -07:00
Jordan Ritter 4570081297 fix(showcase/harness): fix browser-pool close-during-launch teardown race
A browser that is mid-`launch()` is not yet in `this.browsers` and has no
disconnect handler attached, so it is invisible to every teardown path
(shutdown's close pass, recycle, the disconnect handler). Under the
self-heal/relaunch storm introduced by the browser-pool hardening cluster
(#5174/#5185), a concurrent teardown therefore raced an in-flight launch:
the launch escaped teardown accounting entirely — either leaked, or (in
production) the browser was closed underneath the still-resolving
`chromium.launch()`, which then rejected with `browserType.launch: Target
page, context or browser has been closed` (SIGTRAP). The self-heal loop
relaunched forever, each relaunch hitting the same race (336
self-heal-launch-failed events in 4 min), wedging the pool.

Make launches atomic w.r.t. teardown: `launchBrowser()` registers its
launch promise in a new `pendingLaunches` set BEFORE awaiting
`rawLaunchBrowser()` and removes it on settle. `shutdown()` drains
`pendingLaunches` (alongside `inFlightRecycles`) before its close pass, so
it WAITS for every in-flight launch to settle instead of closing the
browser mid-launch. The launch seam re-checks `isShutdown` the instant the
launch settles: if a shutdown intervened it closes the freshly-launched
browser cleanly THEN, exactly once, and throws a shutdown sentinel so the
caller (init / recycle relaunch / self-heal) does not register a browser
into a pool that is going away. The launch-stagger gate still chains off the
raw result, so serialization semantics are unchanged. All #5185 behaviors
(backoff, self-heal, degraded/recovered alarms, waiter draining) preserved.

Adds a red-green test (FIX#13) reproducing an in-flight launch racing a
concurrent shutdown: pre-fix the launching browser escapes teardown
(closeCount 0, leaked); post-fix it is drained + closed cleanly exactly once
with no close-during-launch rejection.
2026-06-03 21:02:12 -07:00
Jordan Ritter b11e87c33f fix(release): route release notifications to #engr instead of #oss-alerts
Release alerts belong in #engr per corrected routing. SLACK_WEBHOOK_ENGR
is the org-wide secret (visibility=all), so no provisioning is needed.
2026-06-03 20:58:57 -07:00
Jordan Ritter 4ea15b9250 feat(release): post one concise #oss-alerts message per release
Add a notify job that runs after both publish lanes via always() and
computes release intent directly from the github.event payload,
independent of the build jobs, so an infra failure in a lane can't
swallow the alert. The job posts the builder's rendered message to
#oss-alerts and includes a best-effort self-watchdog Slack post.
2026-06-03 20:31:03 -07:00
Jordan Ritter 76bbac5073 feat(release): add tested #oss-alerts release-notification builder
Add a pure builder that renders one concise #oss-alerts Slack message
per release from a unit-tested truth table: suppresses canary/dry-run
runs, gates npm/PyPI failure arms on event-derived release intent, and
pages on uncertain state. The CLI wrapper serializes env input to the
builder and writes the result to GITHUB_OUTPUT, failing loud on any
malformed or missing input.
2026-06-03 20:30:57 -07:00
Jordan Ritter 0aaad742fa fix(showcase/harness): commit detail write before advancing run-row counter
The per-target partial-rollup `runWriter.update` (which advances the durable
`probe_runs.summary.{passed,failed}` counters) ran BEFORE `writer.write`
committed the corresponding `status`/`status_history` detail row, and a
`writer.write` failure is intentionally swallowed so one hiccup can't tank
sibling targets. That ordering opened a run-row-orphan window: the run row
could report `failed: N` for a target whose detail row was never durably
written — the stale-red ingestion artifact.

Reorder so the detail/status row is committed first and the run-row counter
is stamped only after, so the persisted counter can never outrun its backing
detail row. Pure statement-order swap — no schema/migration, dashboard read
path untouched, genuine failures still counted.
2026-06-03 20:22:01 -07:00
Jordan Ritter 8f9aeb8096 test(react-core): pin the Enter-vs-button routing contract while running
CopilotChatInput intentionally diverges while a run is in flight: Enter with
sendable text routes to SEND (the consecutive-interrupt unblock from #5195),
while the send/stop button always routes to STOP. Only a comment bound these
two behaviors together. Add a regression test asserting BOTH at once so a
future refactor cannot silently re-converge them (verified red against both a
button-sends-while-running and an Enter-also-stops mutation).
2026-06-03 19:47:38 -07:00
Jordan Ritter 32551f2bdb fix(react-core): type the active-run completion contract and serialize the suggestion send path
Replace the brittle `"activeRunCompletionPromise" in agent` probe + double
`as unknown as` casts in CopilotChat with a typed `RunCompletionAware`
contract plus an `isRunCompletionAware` type guard, both exported from core.
IntelligenceAgent now declares the property and implements the interface, so
the in-flight-run await is reachable without a cast and non-Intelligence
agents still degrade safely. Cast sites in the attachments/e2e tests and the
MockStepwiseAgent helper are updated to the typed accessor.

Factor the await-then-send logic into a shared `waitForActiveRunToSettle`
helper and call it from BOTH onSubmitInput and handleSelectSuggestion. This
closes the suggestion-path in-flight gap: selecting a suggestion mid-run no
longer pre-empts/aborts the active run (e.g. an interrupt RESUME) — the same
regression PR #5195 fixed for the typed-Enter path. Adds a red-green
regression test that parks the suggestion send on the in-flight promise.
2026-06-03 19:47:38 -07:00
Ben Taylor 33dd22e987 revert: back out the ENT-679 Intelligence threads rollout (#5151, #5196, #5205, #5211) (#5217)
## Summary

Reverts the four remaining Intelligence/threads merges, completing the
back-out started by #5215 (langgraph-fastapi) and #5216 (agent-spec):

- Revert #5211 — mcp-apps
- Revert #5205 — a2a-middleware
- Revert #5196 — pydantic-ai
- Revert #5151 — north-star foundation + batch 1 (incl. crewai-flows
#5189 and llamaindex #5199, which merged into it)

## End-state verification

- `git diff be20a389cf HEAD -- examples/integrations` is **empty** —
every integration example is byte-identical to pre-#5151 main
(`be20a389cf`, the merge's first parent).
- `scripts/__tests__/integration-intelligence-migration.test.ts`
(introduced by the rollout) is deleted.
- Total scope vs main: examples/integrations + that test file. Nothing
else touched.

## Heads-up: collateral on two follow-up commits

@jpr5 — your agent-key standardization commits (4bf50c7c41, 2103d0c875)
were written against the post-#5151 trees (they update `agentId` refs on
ThreadsDrawer/CopilotChatConfigurationProvider etc.), so this revert
necessarily takes those files back to their pre-#5151 content, undoing
the rename. Keeping the rename only where it auto-applied would have
left broken half-states (e.g. adk route registering `default` while the
restored layout pins `agent="my_agent"`). If you still want the rename
on the pre-threads files, it needs a fresh pass on top of this.

Also note: #5151 carried the starter-smoke heals (v2 label keys, 1.59.1
bumps, `useSingleEndpoint`, parity sync). Reverting it returns main's
starter smoke to its pre-#5151 state (9 starters red).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-03 20:59:21 -05:00
Benjamin Taylor 3721e7b36b Revert "feat(integrations): Intelligence threads — north-star foundation + batch 1 (7 examples on 1.59.1) [ENT-679] (#5151)"
This reverts commit f3ec5ddcec, reversing
changes made to be20a389cf.

# Conflicts:
#	examples/integrations/adk/src/app/layout.tsx
#	examples/integrations/adk/src/app/page.tsx
#	examples/integrations/agno/src/app/layout.tsx
#	examples/integrations/agno/src/app/page.tsx
#	examples/integrations/crewai-crews/src/app/layout.tsx
#	examples/integrations/llamaindex/src/app/api/copilotkit/[[...slug]]/route.ts
#	examples/integrations/llamaindex/src/app/layout.tsx
#	examples/integrations/llamaindex/src/app/page.tsx
#	examples/integrations/mastra/src/app/layout.tsx
#	examples/integrations/mastra/src/app/page.tsx
#	examples/integrations/ms-agent-framework-dotnet/src/app/layout.tsx
#	examples/integrations/ms-agent-framework-dotnet/src/app/page.tsx
#	examples/integrations/ms-agent-framework-python/src/app/layout.tsx
#	examples/integrations/ms-agent-framework-python/src/app/page.tsx
#	examples/integrations/pydantic-ai/src/app/layout.tsx
2026-06-03 20:47:46 -05:00
Benjamin Taylor 1ef370440b Revert "feat(integrations): add Intelligence threads to pydantic-ai (#5196)"
This reverts commit f4fa8e5c02, reversing
changes made to f3ec5ddcec.

# Conflicts:
#	examples/integrations/pydantic-ai/src/app/page.tsx
2026-06-03 20:46:08 -05:00
Benjamin Taylor 5dfafcbfcf Revert "feat(examples): add Intelligence threads to a2a-middleware (#5205)"
This reverts commit a5fbb5c2b5, reversing
changes made to a9d807d8e7.
2026-06-03 20:44:00 -05:00
Benjamin Taylor 797511f9e3 Revert "feat(integrations): add Intelligence threads to mcp-apps (#5211)"
This reverts commit bc8cec6092, reversing
changes made to 2103d0c875.
2026-06-03 20:43:51 -05:00
Ben Taylor ec856ab314 Revert "feat(integrations): add Intelligence threads to agent-spec" (#5216)
Reverts CopilotKit/CopilotKit#5209
2026-06-03 20:35:16 -05:00
Mike Ryan 806c35e4af Revert "feat(integrations): add Intelligence threads to agent-spec" 2026-06-03 18:33:49 -07:00
Ben Taylor 9e7e7e653d Revert "feat(integrations): add Intelligence threads to langgraph-fastapi" (#5215)
Reverts CopilotKit/CopilotKit#5197
2026-06-03 20:32:13 -05:00
Mike Ryan 1e1aadbad8 Revert "feat(integrations): add Intelligence threads to langgraph-fastapi" 2026-06-03 18:28:56 -07:00
Ben Taylor 11e18e378a feat(integrations): add Intelligence threads to agent-spec (#5209)
## Summary
- add env-gated CopilotKit Intelligence Threads support to the
`agent-spec` integration
- wire the Threads drawer + thread context around the existing A2UI
chat/canvas experience
- align `agent-spec` CopilotKit/AG-UI package pins with the north-star
set and commit its npm lockfile
- extend the Intelligence migration contract to cover `agent-spec`

## Verification
- `npm run build` from `examples/integrations/agent-spec`
- `pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts`
- `pnpm exec oxfmt --check
scripts/__tests__/integration-intelligence-migration.test.ts
examples/integrations/agent-spec/src/app/page.tsx
'examples/integrations/agent-spec/src/app/api/copilotkit/[[...slug]]/route.ts'
examples/integrations/agent-spec/next.config.ts
examples/integrations/agent-spec/src/components/threads-drawer/threads-drawer.module.css
examples/integrations/agent-spec/src/components/threads-drawer/THEME.md`
- pre-commit hook: `pnpm run test && pnpm run check:packages`

## Smoke test
With local Intelligence services and licensed env:
- `GET /api/copilotkit/info` returned `mode: intelligence`,
`licenseStatus: valid`, `a2uiEnabled: true`, and agent `my_a2ui_agent`
- `GET /api/copilotkit/threads?agentId=my_a2ui_agent&limit=20` returned
200
- opened the UI at `http://localhost:3001`, Threads drawer rendered,
sent “Check my inbox”, run endpoints returned 200, the thread persisted,
and the inbox UI rendered five messages

## Notes
- `agent-spec` is not in the parity manifest, so `pnpm parity:verify
--target=agent-spec` reports `unknown instance: agent-spec`; this PR
uses the migration contract instead.
- During smoke, the runtime logged a warning that the `agents` feature
is not licensed, but the Intelligence thread and agent run still
completed successfully.
- The smoke-rendered chat still shows the agent pre-tool sentence twice
around the inbox tool result; that appears to be existing agent/runtime
message behavior rather than Threads wiring.
2026-06-03 20:22:09 -05:00
Benjamin Taylor f26e4b1d81 Merge origin/main into codex/ent-734-agent-spec
Conflict resolution (contract test): keep main's 6-entry array + appRoots
map, add agent-spec (src/app), and merge her REST-transport relaxation
(layout+page concat — agent-spec's provider is page-level) with main's
appRoots-based paths. 43/43 passing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 20:21:57 -05:00
Jordan Ritter 2cacf48ec0 fix(showcase): migrate dead useInterrupt to useHumanInTheLoop for Strategy-B gen-ui-interrupt demos
The gen-ui-interrupt demo across non-LangGraph integrations used
`useInterrupt`, which only renders in response to an AG-UI `on_interrupt`
event emitted by LangGraph's native `interrupt()` primitive. These
backends never emit that event — they expose `schedule_meeting` as a
frontend/HITL tool over the normal tool-call channel (Strategy B) — so
the picker never mounted.

Migrate the 8 clean Strategy-B integrations (ag2, agno, crewai-crews,
mastra, pydantic-ai, spring-ai, llamaindex, claude-sdk-typescript) to
`useHumanInTheLoop`, mirroring the ms-agent-python / ms-agent-dotnet
reference: same `name: "schedule_meeting"`, same zod `{ topic, attendee }`
parameters, same TimePickerCard render, resolving via `respond(...)`.
The framework-specific comment is generalized for accuracy.

The 3 LangGraph integrations keep `useInterrupt` (native interrupt).
built-in-agent and claude-sdk-python already use the equivalent working
`useFrontendTool` pattern and are left unchanged. strands and langroid
are intentionally NOT migrated — their backends declare a
`schedule_meeting(reason)` tool whose param shape conflicts with the
`topic`/`attendee` reference, which needs separate resolution.
2026-06-03 16:38:57 -07:00
Tyler Slaton 55465ded15 fix(skills): resolve Snyk W007/W011 findings in copilotkit-setup skill (#5208)
Fixes the [skills.sh Snyk
findings](https://www.skills.sh/copilotkit/copilotkit/copilotkit-setup/security/snyk)
on the `copilotkit-setup` skill.

**W007 (HIGH, insecure credential handling) — clears this.**
Removed the exact secret-shaped placeholders Snyk flagged
(`OPENAI_API_KEY=sk-...`, `licenseKey="ck_..."`) across `SKILL.md`, both
runtime assets, and `telemetry-setup.md`; replaced with `<your-...>`.
Made env vars the only path (dropped the inline license-key option), and
added `.gitignore`/secret-manager guidance.

**W011 (MEDIUM, indirect prompt injection) — improves, TBD.**
Added a Security notes section (untrusted chat input, least-privilege
`defineTool` handlers, runtime endpoint auth). CopilotKit's entire
purpose is piping user chat into an LLM, so the flagged data-flow
genuinely exists — we'll have to see whether the added guidance is
enough to satisfy the analyzer.

Also bumps the skill version 1.1.0 → 1.1.1.
2026-06-03 16:16:01 -07:00
Ben Taylor bc8cec6092 feat(integrations): add Intelligence threads to mcp-apps (#5211)
## Summary
- add env-gated CopilotKit Intelligence Threads support to the
`mcp-apps` integration
- move the runtime route to `[[...slug]]` with GET/POST/PATCH/DELETE for
thread REST routes
- wire the Threads drawer + locked gate into the existing MCP apps chat
surface
- align CopilotKit/AG-UI versions and commit npm lockfiles for the app
and Three.js MCP server
- extend the Intelligence migration contract to include `mcp-apps`,
including the app-router path differences

## Verification
- `npm run build` from `examples/integrations/mcp-apps`
- `pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts`
- `pnpm exec oxfmt --check
scripts/__tests__/integration-intelligence-migration.test.ts
examples/integrations/mcp-apps/app/page.tsx
examples/integrations/mcp-apps/app/components/threads-drawer/threads-drawer.tsx`

## Licensed smoke
With local Intelligence services from
`/Users/mothra/Projects/test-signups4` and the example `.env` exported:
- `docker compose up -d --wait` reported postgres, redis, and
intelligence healthy
- demo users `1_demo-user` and `demo-user` were seeded/no-op present
- `GET /api/copilotkit/info` returned `mode: intelligence`,
`licenseStatus: valid`, and agent `default`
- `GET /api/copilotkit/threads?agentId=default&limit=20` returned 200
and the Threads drawer rendered persisted threads
- started `npm run dev:mcp` and `next dev --turbopack -p 3024`
- created a new thread, sent “Say hello briefly for the smoke test.”,
`/agent/default/run` returned 200, and the assistant rendered “Hello!”
- after restarting the dev servers, selected the persisted “Quick
Greetings for Testing” thread; the prior user prompt and assistant
response restored, with `/agent/default/connect` returning 200

## Notes
- `3000` was occupied by another local example, so smoke used `3024` for
the Next UI.
- The local thread list contained older experimental thread names from
previous mcp-apps smoke runs; this PR now clears the client thread id
for “New thread” instead of minting a random UUID, so new thread
creation/replay works through the runtime.
2026-06-03 18:04:04 -05:00
Benjamin Taylor a42eb45997 Merge origin/main into codex/ent-734-mcp-apps
Post-merge fix: add the missing examples/integrations/mcp-apps/.env.example
(+ .gitignore negation, crewai-flows precedent) — the contract test
'mcp-apps documents the local Intelligence environment' was failing
because the file was never added. 37/37 passing on the merged tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 18:03:32 -05:00
Jordan Ritter 2103d0c875 refactor(examples): standardize mastra starter agent key to default 2026-06-03 16:01:02 -07:00
Jordan Ritter 4bf50c7c41 refactor(examples): standardize starter agent key to default
Rename the registered agent key from each starter's bespoke name
(my_agent / agno_agent / starterAgent / sample_agent) to "default" so the
7 single-agent sidebar starters match the passing langgraph/strands
starters' config exactly: drop the frontend `agent=` prop on <CopilotKit>
(falls back to "default") and update the runtime route registration plus
every agentId reference in page.tsx (ThreadsDrawer,
CopilotChatConfigurationProvider, useAgent/useCoAgent).

The functional `useSingleEndpoint={false}` fix that makes starter chat
reach the agent already landed on main; this change brings the agent-key
config in line with the passing set. mastra is intentionally left on its
framework-derived key (MastraAgent.getLocalAgents) — its keys are not
literals and cannot be forced to "default" without diverging from Mastra.

Verified locally via agno docker-compose.test.yml smoke (aimock): @chat
round-trip passes (assistant streams in ~1.0s) with the standardized
"default" key; removing useSingleEndpoint={false} reproduces the documented
404 / "no assistant response" failure (chat degrades to ~1.1m, @interaction
fails on single-endpoint 404s).
2026-06-03 16:01:02 -07:00
Austin Merrick d3a86fe217 fix(skills): resolve Snyk W007/W011 findings in copilotkit-setup
W007 (HIGH, insecure credential handling):
- Replace secret-shaped placeholders (sk-..., ck_...) with descriptive
  <your-...> placeholders in SKILL.md, both runtime assets, and
  telemetry-setup.md
- Make env vars the only path for API keys and the license key (drop the
  inline license-key option); source apiKey from process.env, never a literal
- Add .gitignore / secret-manager guidance for env files

W011 (MEDIUM, indirect prompt injection):
- Add a 'Security notes' section covering untrusted chat input,
  least-privilege defineTool handlers, and runtime endpoint auth

Bump skill version 1.1.0 -> 1.1.1.
2026-06-03 15:56:12 -07:00
Ben Taylor a5fbb5c2b5 feat(examples): add Intelligence threads to a2a-middleware (#5205)
## Summary
- add env-gated CopilotKit Intelligence runtime wiring to
`examples/integrations/a2a-middleware`
- move the app onto the v2 provider/chat thread context with the
reusable Threads drawer
- preserve the A2A research/analysis/orchestrator URL flow while
isolating runtime agent instances for thread/title generation
- pin the standalone example to the threads-capable CopilotKit/AG-UI
packages and document local Intelligence env vars
- extend the integration migration regression test coverage for
a2a-middleware

## Verification
- `pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts`
- `pnpm exec oxfmt --check
scripts/__tests__/integration-intelligence-migration.test.ts
examples/integrations/a2a-middleware/app/page.tsx
examples/integrations/a2a-middleware/components/chat.tsx
'examples/integrations/a2a-middleware/app/api/copilotkit/[[...slug]]/route.ts'
examples/integrations/a2a-middleware/next.config.ts
examples/integrations/a2a-middleware/postcss.config.mjs`
- `npm run build` from `examples/integrations/a2a-middleware`
- local Intelligence stack: `GET
/api/copilotkit/threads?agentId=a2a_chat` returned `200`
- Playwright smoke check: licensed Threads drawer renders on desktop,
mobile has no horizontal overflow after responsive layout fix

## Notes
- The full live A2A agent response path was not exercised locally
because this shell did not have a Google/Gemini key available for the
Python agents. The Next build still completes; missing local A2A
services only produce the existing non-fatal agent-card fetch noise
during static collection.
2026-06-03 17:52:10 -05:00
Benjamin Taylor a8ca87a597 Merge origin/main into codex/ent-734-a2a-middleware
Conflict resolution: take main's 4-entry migratedIntegrations array and
keep the a2a-middleware-specific contract tests + helper (a2a-middleware
uses app/ root + custom chat, so it doesn't fit the parameterized
src/app contract). 31/31 passing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 17:51:49 -05:00
Martha Schumann 1c4d2d4951 fix(integrations): restore mcp-apps thread replay 2026-06-03 15:43:48 -07:00
Martha Schumann 42e7509de3 fix(integrations): clean mcp-apps drawer cleanup 2026-06-03 15:39:47 -07:00
Martha Schumann 811458931f feat(integrations): add Intelligence threads to mcp-apps 2026-06-03 15:39:47 -07:00
Martha Schumann 4a2fdb611b feat(integrations): add Intelligence threads to agent-spec 2026-06-03 15:33:25 -07:00
Ben Taylor a9d807d8e7 feat(integrations): add Intelligence threads to langgraph-fastapi (#5197)
## Summary
- add env-gated CopilotKitIntelligence runtime wiring to
langgraph-fastapi while preserving the FastAPI-specific
LangGraphHttpAgent path
- add the shared Threads drawer/locked panel UI and threadId wiring for
the canvas/chat demo
- bump langgraph-fastapi CopilotKit deps to 1.59.1, add its
package-lock, and document local Intelligence env vars
- remove the temporary langgraph-fastapi parity allowances for
now-verbatim Threads/page/next files
- add a focused batch-2 migration contract test for langgraph-fastapi

## Verification
- confirmed the new migration test failed before implementation
- pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts
- pnpm parity:verify --target=langgraph-fastapi (90 ok, 1 existing
next-env.d.ts warning, 0 errors)
- npm run build (in examples/integrations/langgraph-fastapi)
- pnpm exec oxfmt --check <touched TS/TSX/JSON files>
- git diff --check
- commit hook: check-binaries, sync-lockfile, lint-fix,
test-and-check-packages, commitlint
- manual licensed Threads smoke test with local Intelligence composite:
- copied /Users/mothra/Projects/test-signups4/.env into the example .env
and supplied a valid local OPENAI_API_KEY
- docker compose up -d --wait from /Users/mothra/Projects/test-signups4
  - seeded demo-user / 1_demo-user in cpki.users
- started dev with exported .env: set -a; . ./.env; set +a; npm run dev
- /api/copilotkit/info returned mode=intelligence, licenseStatus=valid,
version=1.59.1
  - /api/copilotkit/threads?agentId=default returned 200
  - licensed Threads UI visible
  - selected/restored persisted thread
- created a fresh thread, sent a todo request, agent response rendered,
todo state updated
- refreshed and selected the named thread again; chat history, tool
calls, assistant response, and todo state restored

## Notes
- Targets the PR #5151 lineage branch because batch-2 depends on the
Intelligence foundation from ENT-679.
- The first manual smoke attempt failed because the copied local env had
an empty OPENAI_API_KEY; after replacing it in the ignored example .env
and restarting, the fresh smoke passed.
2026-06-03 17:30:33 -05:00
Benjamin Taylor d38bac48d4 Merge origin/main into codex/ent-734-langgraph-fastapi
Conflict + post-merge resolutions:
- integration test (add/add): fold into the parameterized batch-2 contract
  test; migratedIntegrations now includes langgraph-fastapi (24/24 pass).
- _parity/manifest.json: keep her langgraph-fastapi allowance removals
  (threads-drawer/page.tsx/next.config now fully tracked), but drop the
  stale strands-python shielding her branch added (example-layout +
  docker-route-override divergence, @copilotkit 1.56.5 packageJsonOverrides)
  — strands is already parity-synced at 1.59.1 on main; those overrides
  would have made the next parity:sync rewrite it back to 1.56.5.
- parity verify on the merged tree: langgraph-js 82 ok / langgraph-fastapi
  91 ok / strands-python 83 ok, zero drift.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 17:30:16 -05:00
Martha Schumann 691afa5890 feat(examples): add Intelligence threads to agentcore 2026-06-03 15:24:40 -07:00
Ben Taylor f4fa8e5c02 feat(integrations): add Intelligence threads to pydantic-ai (#5196)
## Summary
- migrate the pydantic-ai example to the Intelligence-ready v2
CopilotKit setup
- add the shared Threads drawer with REST transport, env-gated
Intelligence runtime, and local env docs
- pin the example to CopilotKit 1.59.1 and add a migration contract test

## Verification
- pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts
- pnpm exec oxfmt --check
scripts/__tests__/integration-intelligence-migration.test.ts
examples/integrations/pydantic-ai/src/app/page.tsx
- git diff --check
- npm run build (examples/integrations/pydantic-ai)
- pre-commit hook: package tests plus publint/attw passed
- manual smoke: started local pydantic-ai app with Intelligence env,
loaded http://localhost:3000, verified Threads drawer, sent Read Agent
State, selected persisted thread, and confirmed the
prompt/tool/assistant exchange hydrated from the thread

## Notes
- Targets ben1/ent-679-intelligence-ready-north-star to stack on the PR
5151 Intelligence-ready baseline.
- The local smoke logs include a non-fatal initial THREAD_NOT_FOUND
lookup for a newly minted thread before it is created; the thread is
then created, listed, and hydrates successfully.
2026-06-03 17:18:23 -05:00
Benjamin Taylor 62c5489614 Merge origin/main into codex/ent-734-pydantic-ai
Conflict resolutions:
- page.tsx: keep the threads layout; swap the dead v1 sidebar labels
  (title/initial) for the v2 keys (modalHeaderTitle 'Popup Assistant' +
  welcomeMessageText) the starter smoke asserts, and carry over main's
  disableSystemMessage + clickOutsideToClose. Keep her useRenderTool
  render({ parameters }) — that is the actual v2 RenderToolProps shape;
  main's render({ args }) was a latent runtime bug (args is not a prop).
- package.json: keep the drawer UI deps (class-variance-authority, clsx).
- integration test: fold into the parameterized batch-2 contract test;
  migratedIntegrations now crewai-flows + llamaindex + pydantic-ai (18/18).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 17:18:04 -05:00
Ben Taylor f3ec5ddcec feat(integrations): Intelligence threads — north-star foundation + batch 1 (7 examples on 1.59.1) [ENT-679] (#5151)
## Summary

**Threads/Intelligence rollout across the integration examples
([ENT-679](https://linear.app/copilotkit/issue/ENT-679)) — the shared
foundation + Batch 1.** Makes the **`langgraph-python` north-star**
Intelligence-ready, ships the framework-agnostic activation overlay +
parity wiring, and integrates the **six Batch-1 examples**,
standardizing everything on **`@copilotkit/* 1.59.1`**.

> Originally two stacked PRs; the batch-1 work was folded into this
branch so it's reviewed as one unit.

## Per-example status
| Example | agent | threads | demo | `next build` | verified |
|---|---|---|---|---|---|
| langgraph-python (north-star) | `default` | ✅ | todo (CopilotChat) | ✅
| bumped 1.56.5→1.59.1 |
| langgraph-js | `default` | ✅ | todo (shared) | ✅ | build |
| mastra | `weatherAgent` | ✅ | proverbs/weather/moon | ✅ | ✅ **full
E2E** |
| adk | `my_agent` | ✅ | proverbs (`useRenderTool` weather) | ✅ | build
|
| agno | `agno_agent` | ✅ | proverbs (local state) + tools | ✅ | build |
| ms-agent-framework-python | `my_agent` | ✅ | proverbs/weather/moon | ✅
| build |
| ms-agent-framework-dotnet | `my_agent` | ✅ | proverbs/weather/moon | ✅
| build |

## What's in it

**Foundation (north-star + shared):**
- **Env-gated runtime wiring** (`route.ts`): license →
`CopilotKitIntelligence` + `identifyUser` + `licenseToken`; otherwise
`InMemoryAgentRunner`. Marker-fenced for opt-out; multi-route endpoint.
- **Threads frontend**: `threads-drawer/**` refactored into a
**token-driven themeable base** + locked-state tease; `next.config`
derives `NEXT_PUBLIC_COPILOTKIT_THREADS_ENABLED` from the license
(SSR-safe client mount). **Without a license the panel renders locked.**
- **`_intelligence/` activation overlay**: docker-compose (postgres +
redis + composite `0.2.0`), init-db, `.env.intelligence`, an idempotent
**`provision-user`** one-shot (`demo-user`), and
**`CHECK_ORIGIN=false`** so the local realtime-gateway accepts the app's
websocket origin (live thread updates).
- **Parity staging**: `threads-drawer/**` tracked as `verbatimFiles`
(north-star canonical); per-example threads files in
`allowedDivergence`.

**Batch 1 (per example):** the env-gated route branch (multi-route +
**`useSingleEndpoint={false}`** REST transport, no `organizationId`); a
**bespoke themed threads panel** matching each example's chat; the
`next.config` gate; `demo-user` identity.

**v2 demo migration** — the 1.59.1 bump broke the V1-era
proverbs/weather/moon demos, so:
- `useAgent({ agentId })` → `{ agent }` (read `agent.state`, write
`agent.setState`);
- `useFrontendTool` params as **Zod** schemas (not the V1 array);
- `<CopilotSidebar>` content as a **sibling** (v2 slot model), not
children — otherwise the canvas silently never mounts;
- guarded card state for the async-loaded agent state.

## Verification
- All seven examples **`next build` clean** (`/` prerenders; gate holds
in both license states).
- **Full end-to-end on mastra** against the running stack: thread
create/list/auto-name, agent run, generative-UI + frontend-tool +
human-in-the-loop, **live websocket updates**, demo renders, clean
console.
- The other five are build-clean and under **per-example
visual/functional review** (fixes land on this branch).

## Known follow-ups / not in this PR
- Per-example visual + functional review (in progress).
- `langgraph-fastapi` / `strands-python` (parity instances, **Batch 2**)
stay on `1.56.5`, so the parity-tracked `@copilotkit/*` version field
diverges from the bumped north-star until Batch 2 (parity-check already
red on `main`; branch protection off).
- Retiring `langgraph-python-threads` (kept as reference), showcase
`manifest.yaml` registration ("marketing"), inspector locked-panel
(ENT-680), and the CLI `-i` allowlist flips (separate Intelligence-repo
PR).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-03 17:08:33 -05:00
Martha Schumann fc6f8e4503 feat(examples): add intelligence threads to a2a-middleware 2026-06-03 15:04:42 -07:00
Ben Taylor 53af72b8e9 feat(integrations): add Intelligence threads to llamaindex (#5199)
## Summary

- Migrates the LlamaIndex example onto the Intelligence/Threads path
from the PR 5151 golden pattern.
- Pins the example to CopilotKit `1.59.1`, switches to the v2
chat/runtime wiring, and adds the shared mobile floating Threads drawer
experience.
- Adds optional Intelligence env wiring with an in-memory fallback when
no license token is configured.
- Adds a contract test covering the LlamaIndex migration surface so
future example migrations can stay red/green.

## Verification

- `pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts`
- `pnpm exec oxfmt --check
examples/integrations/llamaindex/src/app/page.tsx
examples/integrations/llamaindex/src/app/layout.tsx
examples/integrations/llamaindex/src/app/api/copilotkit/[[...slug]]/route.ts
examples/integrations/llamaindex/src/components/threads-drawer
examples/integrations/llamaindex/src/components/ui
examples/integrations/llamaindex/src/lib/utils.ts
scripts/__tests__/integration-intelligence-migration.test.ts`
- `git diff --check`
- `npm run build` from `examples/integrations/llamaindex`
- Pre-commit `test-and-check-packages` passed on commit.

## Manual smoke

- Started local Intelligence stack and LlamaIndex example with licensed
env.
- Confirmed Threads drawer loads via `/api/copilotkit/threads` and
persisted threads render/select correctly.
- Verified a backend-tool conversation: “Get the weather in San
Francisco.” created/named a persisted thread, rendered the weather card,
and hydrated correctly after refresh/reselect.

## Notes

- Observed the same non-fatal initial `THREAD_NOT_FOUND` lookup pattern
before thread creation that appears in other migrated examples.
- The LlamaIndex frontend-tool path (`add_proverb`) exposes an
adapter-specific streamed tool-argument issue where two JSON argument
payloads arrive concatenated. I did not address that in this migration;
the backend-tool path and Threads persistence smoke cleanly.
2026-06-03 17:03:53 -05:00
Benjamin Taylor 8b04e695bd Merge ben1/ent-679-intelligence-ready-north-star into codex/ent-734-llamaindex
Conflict resolutions:
- page.tsx: keep the threads layout (drawer + gate + provider) and restore
  the v2 sidebar labels (modalHeaderTitle 'Popup Assistant' +
  welcomeMessageText) the starter smoke asserts, plus clickOutsideToClose.
- layout.tsx: keep the REST-transport explainer comment.
- integration test: keep the parameterized batch-2 contract test from
  crewai-flows and add llamaindex to migratedIntegrations (12/12 pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 17:03:04 -05:00
Mark Fogle 51945013c2 feat(react-core): A2UI recovery status renderer (OSS-162)
Render the `a2ui_recovery` activity the middleware emits — as a pure DATA
CONTRACT, no @ag-ui/a2ui-toolkit dependency on the React client (mirrors how
a2ui-surface / a2ui_operations are consumed by activityType + content keys):

- createA2UIRecoveryRenderer() -> ReactActivityMessageRenderer for
  activityType "a2ui_recovery":
  - "retrying": a non-disruptive, collapsed "Retrying UI generation…" hint that
    only appears once perceptible (after showAfterMs, or once attempts cross
    showAfterAttempts) so a fast first retry never flashes; never replaces the
    surface, never shows noisy errors inline.
  - "failed": a clean, tasteful hard-failure message for end users, with the
    structured developer detail tucked into an expandable <details>.
  - "resolved"/unknown: renders nothing (the surface renderer owns the UI).
- Timing + debugExposure are client-configurable (A2UIRecoveryRendererOptions),
  surfaced via CopilotKitProvider's `a2ui.recovery`.
- Registered as a built-in renderer when runtime A2UI is enabled; exported.

7 renderer unit tests green (jsdom).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 21:57:10 +00:00
jpr5 be20a389cf chore: release monorepo v1.59.3 v1.59.3 2026-06-03 14:53:22 -07:00
Austin Merrick 0c530edb5d docs(build-with-agents): always show Skills + flesh out section + fix MCP heading nesting (#5194)
Quick-win fixes for the **Build with agents** page from Sam's review.
Stacked on #5187 (retarget to `main` once it lands).

## Changes

- **Skills now shown on every page** — previously only the top-level
`/build-with-agents` (and `built-in-agent`) rendered the Skills section;
every framework integration page used the MCP-only snippet, hiding
Skills. The shared `coding-agents.mdx` now renders the full Skills + MCP
guide, so all 11 build-with-agents pages show Skills (the recommended
path).
- **Skills section** — added a top-three table (`copilotkit-setup`,
`copilotkit-develop`, `copilotkit-integrations`) and a note that
`copilotkit-contribute` is for contributing to CopilotKit, not building
with it.
- **Install step** — clarified to run `npx skills add` from the project
root; any agent there (Claude Code, Codex, Cursor, Gemini CLI) discovers
the skills automatically.
- **MCP headings** — demoted per-tool headers (Cursor, Claude Code, …)
from H2 → H3 so they nest under "MCP Docs Server" in the TOC; "Other"
subsections H3 → H4.

## Screenshots

Skills section + top-three table:

![Skills
section](https://raw.githubusercontent.com/CopilotKit/CopilotKit/docs-assets/pr-5194/skills-table.png)

Install step:

![Install
step](https://raw.githubusercontent.com/CopilotKit/CopilotKit/docs-assets/pr-5194/install-step.png)

Skills now rendering on a framework page (Mastra) that was previously
MCP-only:

![Mastra
build-with-agents](https://raw.githubusercontent.com/CopilotKit/CopilotKit/docs-assets/pr-5194/mastra-skills.png)

TOC nesting (tools now under MCP Docs Server):

![TOC
nesting](https://raw.githubusercontent.com/CopilotKit/CopilotKit/docs-assets/pr-5194/toc-nesting.png)

## Files
-
`showcase/shell-docs/src/content/snippets/shared/guides/build-with-agents.mdx`
-
`showcase/shell-docs/src/content/snippets/shared/guides/mcp-server-setup.mdx`
- `showcase/shell-docs/src/content/snippets/shared/coding-agents.mdx`
-
`showcase/shell-docs/src/content/docs/integrations/langgraph/build-with-agents.mdx`
2026-06-03 14:46:49 -07:00
Ben Taylor 57d72491df feat(integrations): add Intelligence threads to crewai-flows (#5189)
## Summary
- add env-gated CopilotKitIntelligence runtime wiring to crewai-flows
- add Threads drawer/locked panel UI and shared threadId wiring for the
CopilotSidebar demo
- bump crewai-flows CopilotKit deps to 1.59.1 and add local Intelligence
env docs
- add a focused batch-2 migration contract test for crewai-flows
- fix two manual-smoke regressions found during the licensed Threads
pass: stale sidebar props and circular frontend-tool deps

## Verification
- confirmed the new migration test failed before implementation
- pnpm exec vitest run
scripts/__tests__/integration-intelligence-migration.test.ts
- npm run build (in examples/integrations/crewai-flows)
- pnpm exec oxfmt --check <touched files>
- git diff --check
- commit hook: check-binaries, sync-lockfile, lint-fix,
test-and-check-packages, commitlint
- manual licensed Threads smoke test with local Intelligence composite:
  - Threads licensed UI loads and thread list returns 200
  - creating/selecting a thread no longer crashes
- suggestion message runs through the CrewAI agent with a valid OpenAI
key
  - agent response renders in chat
  - persisted thread appears in the drawer and receives an updated title

## Notes
- Targets the PR #5151 lineage branch because batch-2 depends on the
Intelligence foundation from ENT-679.
2026-06-03 16:45:02 -05:00
Benjamin Taylor acd76b17e9 fix(examples/crewai-flows): v2 label keys for the sidebar
labels.title/initial are dead v1 keys in the v2 CopilotSidebar — the header
rendered the default 'CopilotKit Chat' instead of 'Popup Assistant' and the
greeting never showed. Map to the v2 CopilotChatLabels keys
(modalHeaderTitle / welcomeMessageText), matching every other migrated
starter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 16:44:23 -05:00
Benjamin Taylor ad04fd89d4 Merge ben1/ent-679-intelligence-ready-north-star into codex/ent-734-crewai-flows
Brings in the base-branch fixes (main merge, v2 label keys, parity sync,
starter heals) so this PR's CI reflects its own change rather than the
pre-fix base. No conflicts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 16:44:06 -05:00