mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
8f04764e9c
## Problem
The deployed Slack triage bot (`examples/slack`) started failing
**every** turn with:
```
400 Invalid schema for function 'save_diff_comment':
In context=('properties','anchor'), 'propertyNames' is not permitted.
```
No change on our side triggered it — Linear's hosted MCP server changed
the `save_diff_comment` tool schema. Its `anchor` param is now a
free-form map (open object declared with `propertyNames` + open
`additionalProperties`). The bot fetches Linear's tool list at runtime,
so it picked up the new schema automatically.
## Root cause
`@tanstack/ai-openai@0.15.2` (what the bot resolves to) forces `strict:
true` on every function tool. OpenAI's strict function-calling validator
only accepts a subset of JSON Schema and **rejects the entire request
(400, before the model runs)** for a free-form-map object like `anchor`.
One over-rich third-party tool takes down the whole turn.
## Fix — adopt the upstream fix via a dependency upgrade
Already fixed upstream: `@tanstack/openai-base@0.9.8`
([tanstack/ai#933](https://github.com/TanStack/ai/pull/933)) makes the
tool converter detect free-form-map schemas and emit those tools with
`strict: false` (so they stay callable) instead of forcing an invalid
strict schema. First ships in `@tanstack/ai-openai@0.17.0`.
The bot's `^0.15.2` range can't reach it, so this bumps the aligned set
and refreshes `pnpm-lock.yaml`:
| package | before | after |
|---|---|---|
| `@tanstack/ai` | `^0.32.0` | `^0.42.0` |
| `@tanstack/ai-openai` | `^0.15.2` | `^0.17.1` (→ `openai-base@0.9.9`)
|
| `@tanstack/ai-mcp` | `^0.1.3` | `^0.2.5` |
**zod stays at `^3.25.76`.** The repo pins zod to 3.x via a root
`pnpm.overrides` (`zod: ">=3.22.3"`), so the whole workspace resolves
zod 3 regardless. `ai-openai@0.17` peers `zod ^4` (unmet → advisory
warning only), but the strict-schema fix operates on plain JSON Schema,
not zod, so it's unaffected.
**No runtime code change** — the fix lives entirely in the upgraded
adapter (an earlier revision of this PR hand-rolled a schema sanitizer;
that's removed in favor of leaning on TanStack's built-in handling).
## Verification
⚠️ Not verifiable in this worktree (example deps aren't installed here).
Before merge, in an installed env:
- `pnpm --filter slack-example check-types` and `pnpm --filter
slack-example test`
- One live turn hitting Linear (previously-failing `save_diff_comment`
path)
- Sanity-check the bot runs on the workspace's pinned **zod 3** despite
`ai-openai@0.17`'s `zod ^4` peer (the fix path is zod-independent, but
confirm no other `@tanstack/ai` code the bot exercises needs a
zod-4-only API).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
CopilotKit Examples
This directory contains 50 consolidated demo repositories showcasing CopilotKit integrations, canvas apps, and showcases.
Each example is a self-contained project. To get started:
GIT_LFS_SKIP_SMUDGE=1 git clone <repo-url>
cd examples/<category>/<name>
# Follow the example's own README for setup instructions
Note: The
v1/andv2/directories at the top level are legacy workspace examples from earlier CopilotKit releases and are not part of the consolidated demo set.
Integrations (19)
Framework integration starters demonstrating CopilotKit with various agent frameworks.
| Example | Description |
|---|---|
| langgraph-python | Starter template for building AI agents using LangGraph (Python) and CopilotKit |
| langgraph-js | Starter template for building AI agents using LangGraph (JS) with Turborepo monorepo |
| langgraph-fastapi | Starter template for building AI agents using LangGraph with FastAPI and Poetry |
| mastra | Starter template for building AI agents using Mastra and CopilotKit |
| crewai-flows | Starter template for building AI agents using CrewAI Flows (uv-based) |
| llamaindex | Starter template with a LlamaIndex investment analyst agent |
| pydantic-ai | Starter template with a PydanticAI investment analyst agent |
| ms-agent-framework-python | CopilotKit with Microsoft Agent Framework (Python/FastAPI, AG-UI protocol) |
| ms-agent-framework-dotnet | CopilotKit with Microsoft Agent Framework (.NET/C#, AG-UI protocol) |
| strands-python | Starter template with a Strands investment analyst agent |
| mcp-apps | Integration of MCP Apps with CopilotKit using Three.js |
| adk | Starter template using Google ADK with an investment analyst agent |
| agent-spec | Starter for Agent Spec with A2UI-powered frontend tool rendering |
| a2a-a2ui | Starter for A2UI + A2A with a restaurant finder agent (Gemini/ADK) |
| agno | Starter template using Agno with an investment analyst agent |
| crewai-crews | Starter template for building AI agents using CrewAI Crews |
| a2a-middleware | Multi-agent starter with A2A Protocol and AG-UI Protocol (LangGraph + ADK) |
| claude-sdk-python | Starter template using the Claude Agent SDK (Python) and CopilotKit |
| claude-sdk-typescript | Starter template using the Claude Agent SDK (TypeScript) and CopilotKit |
Canvas (7)
AI-powered canvas applications with visual card interfaces, real-time state sync, and HITL workflows.
| Example | Description |
|---|---|
| langgraph-python | AG-UI canvas starter with LangGraph — interactive cards with real-time AI sync |
| llamaindex | AG-UI canvas starter with LlamaIndex — visual cards, multi-step planning, HITL |
| llamaindex-composio | Hackathon starter with LlamaIndex, CopilotKit, and Composio (Google Sheets integration) |
| pydantic-ai | AG-UI canvas starter with PydanticAI — visual cards, planning, HITL |
| mastra | AG-UI canvas starter with Mastra — interactive cards with real-time AI sync |
| gemini | Open Gemini Canvas — post generator and stack analyzer agents (Gemini + LangGraph) |
| mastra-pm | AG-UI + Mastra workshop — shared state, multiple clients, generative UI |
Showcases (24)
Full-featured demo applications highlighting CopilotKit capabilities in real-world scenarios.
| Example | Description |
|---|---|
| banking | Banking app demo with authorization, multiple operations, and generative UI |
| presentation | PowerPoint-like web app built with CopilotKit |
| deep-agents | Deep research assistant with planning, memory/files, and generative UI (Tavily) |
| deep-agents-job-search | Job application assistant — resume parsing, skill extraction, DeepAgents orchestration |
| generative-ui | Generative UI for agentic apps — AG-UI protocol showcase |
| generative-ui-playground | Playground for static GenUI, MCP Apps, and A2UI generative UI types |
| mcp-apps | MCP Apps demo — airline booking, hotel booking, investment simulator, kanban board |
| research-canvas | ANA (Agent Native Application) — research canvas with Tavily search and LangGraph |
| mcp-demo | Working Memory — MCP server-client integration for project management (Linear) |
| strands-file-analyzer | AI-powered document analysis with Strands Agents and Amazon Bedrock |
| microsoft-kanban | Kanban board demo with CopilotKit + Microsoft Agent Framework (.NET, AG-UI) |
| multi-page | Multi-page Remix app with CopilotKit |
| orca | Cisco CopilotKit demo — PR and repository analytics dashboard |
| pydantic-ai-todos | AI-powered todo board with PydanticAI (Todo, In-Progress, Done columns) |
| scene-creator | Scene creator with LangGraph + Gemini 3 — AI-generated characters and backgrounds |
| adk-dashboard | Generative canvas with Google ADK — metrics, charts, and real-time data |
| langgraph-js-support-agents | Multi-agent telecom support system with intent, lookup, reply, and escalation agents |
| multi-agent-canvas | Open Multi-Agent Canvas — manage multiple agents (travel, research, MCP) in one chat |
| chatkit-studio | Open ChatKit Studio — explore and build embeddable chat experiences |
| enterprise-brex | Enterprise banking demo with authorization, operations, and generative UI |
| a2a-travel | A2A + AG-UI multi-agent travel demo (LangGraph + Google ADK) |
| spreadsheet | AI-powered Excel-like spreadsheet web app |
| todo | Simple todo app built with CopilotKit |
| strands-crm | Enterprise sales CRM — dashboard, pipeline, products, quotes, reports & agentic canvas (TypeScript Strands + AG-UI) |