Repository navigation
Description
♻️ Reproduction Steps
- Mount the provider with a custom catalog (5 custom components) and
includeSchema: false:<CopilotKit agents__unsafe_dev_only={{ default: agent }} a2ui={{ catalog, includeSchema: false }}>
- Read the registered agent context (
useCopilotKit().copilotkit.context). - Repeat with
includeSchema: true(the default).
✅ Expected Behavior
The provider reference describes includeSchema as "When true (default), full component schemas are sent as agent context so the agent knows what's available", and the JSDoc on CopilotKitProvider says "Set to false to disable". So with false I expected the custom components' JSON schemas not to be sent, e.g. only the catalog ID and component names/descriptions. With true I expected each schema to be sent once.
❌ Actual Behavior
Measured on 1.79.0 with a 5-component custom catalog:
includeSchema |
A2UI context entries | chars of agent context |
|---|---|---|
false |
1: "A2UI catalog capabilities" | 10,484, including the full JSON schema of all 5 custom components |
true |
4: capabilities (10,484) + "A2UI Component Schema" (56,043) + generation (4,208) + design guidelines (1,509) | 72,244 |
A2UICatalogContext always registers the capabilities entry, built by buildCatalogContextValue(catalog), which embeds zodToJsonSchema of each custom component. includeSchema only gates the other three entries (packages/react-core/src/v2/a2ui/A2UICatalogContext.tsx, lines 36–48). So:
includeSchema: falsestill sends every custom component's schema;- the default sends each custom component's schema twice, once in capabilities and again in the Component Schema entry.
Why it matters to me: I use a direct-connect setup with a local model, where the Python tool emits the A2UI operations itself, so the agent never needs the schemas. 10.5k chars of agent context is a real share of a local model's context window, and includeSchema: false looked like the switch for it. The fallback is to not pass a2ui at all and mount A2UIProvider / A2UIRenderer myself, which works but skips the provider's built-in renderer.
Screenshots
No response
𝌚 CopilotKit Version
`@copilotkit/react-core` / `@copilotkit/a2ui-renderer` 1.79.0 (also seen on 1.67.1).
Is this intended? A few options, if any is useful:
1. When `includeSchema` is `false`, have the capabilities entry list catalog IDs plus component names and descriptions only.
2. When it's `true`, drop the schemas from the capabilities entry, since the Component Schema entry already has them.
3. If the current behaviour is intended, document that `includeSchema: false` only removes the schema and guideline entries, so readers know the per-component schemas are still sent.
Happy to send a PR for whichever you prefer.
Activity
copilotkit-outpost-bot commentedon Oct 13, 2026
The behavior you've described is accurate based on the source code.
buildCatalogContextValueinpackages/a2ui-renderer/src/react-renderer/catalog-utils.ts(lines 74–82) always callszodToJsonSchemafor every custom component and embeds the result in the capabilities string. That entry is registered unconditionally.includeSchemainpackages/react-core/src/v2/a2ui/A2UICatalogContext.tsx(lines 43–48) only gates the three additional entries (Component Schema, generation guidelines, design guidelines). So your measurements are correct:includeSchema: falsestill sends the full per-component JSON schemas via the capabilities entry, andincludeSchema: truesends them a second time in the Component Schema entry.Whether this is intended or a gap in the current design is a call for engineering to make — I won't speculate on that. Your three proposed options are clearly articulated, and a PR offer is noted. The team will pick this up from here.
🤖 Generated by CopilotKit AI Support · Documentation
Was this helpful? React with 👍 or 👎
BenTaylorDev commentedon Oct 23, 2026
Thanks for the measurements. This is a gap, not intended behavior. Please go with option 1: when
includeSchemaisfalse, the capabilities entry lists the catalog IDs and component names only, without the JSON schemas.Please keep the following in the PR:
includeSchemaistrue. That rules out option 2 for now. The LangGraph middleware (packages/sdk-js/src/langgraph/middleware.tsandsdk-python/copilotkit/copilotkit_lg_middleware.py) finds this entry by its "A2UI catalog" description and sends its whole value to the subagent as the composition guide.- <catalogId>first-line format. The middleware reads the catalog ID from it.packages/vue/src/v2/components/a2ui/A2UICatalogContext.ts,packages/angular/src/lib/components/a2ui/a2ui-catalog-context.ts), so all three frameworks send the same context.includeSchemaJSDoc and the provider reference to say whatfalsestill sends.One consequence to call out in the PR: the LangGraph middleware's A2UI subagent currently gets its custom-component schemas from this entry. With option 1, a host that sets
includeSchema: falseand uses the injected A2UI tool will give the subagent names only. That matches whatfalsesays it does, but please state it in the PR description and theincludeSchemadocs, and mention that a host can still pass acomposition_guidethrough the middleware's guidelines.Laptopmini commentedon Oct 23, 2026
Thanks @BenTaylorDev, option 1 it is.
Heads-up: @Arpit-Khandelwal already opened #7810 for this. It does option 1 for React (
catalog-utils.ts+A2UICatalogContext.tsx), with tests.truestays byte-for-byte the same and the- <catalogId>line is unchanged, so the first two points on your list are covered. It doesn't include the Vue and Angular copies, theincludeSchemaJSDoc and reference docs, or the LangGraph note.Those changes are in different files from #7810, so I can open a separate PR with them that doesn't conflict with it:
packages/vue/src/v2/components/a2ui/A2UICatalogContext.ts) and Angular (packages/angular/src/lib/components/a2ui/a2ui-catalog-context.ts): same name-only output whenincludeSchemaisfalse, with tests;includeSchemaJSDoc on the React, Vue and Angular providers, plus the provider reference pages: whatfalsestill sends (catalog ID and component names);false, and that a host can pass acomposition_guidethrough the middleware's guidelines.@Arpit-Khandelwal, if you'd rather add these to #7810 yourself, that works for me too. Just say so here and I'll leave it to you.
Arpit-Khandelwal commentedon Oct 23, 2026
Thanks @BenTaylorDev, and thanks @Laptopmini for the heads-up. I'll add these to #7810 myself: the Vue and Angular copies with tests, the
includeSchemaJSDoc and provider reference docs, and the LangGraph subagent note (names only withfalse,composition_guidethrough the middleware's guidelines). I'll ping here when it's pushed.fix(vue,angular): omit component schemas from catalog context when in…
docs: describe what includeSchema false still sends to the agent
Arpit-Khandelwal commentedon Oct 23, 2026
@BenTaylorDev pushed to #7810:
includeSchema: falsethe entry lists the catalog ID and component names only. All three frameworks emit the identical string for the same catalog, and each package's tests assert that literal.true(and the default) is byte-for-byte unchanged in all three, schemas included. The- <catalogId>first line and the "A2UI catalog" description are untouched.includeSchemaJSDoc on the React, Vue and Angular providers and the provider reference pages now say whatfalsestill sends.false, the injected A2UI subagent gets component names only. A host can still pass a composition guide through the middleware's guidelines:a2uiParams.guidelines.compositionGuidein JS,a2ui_params["guidelines"]["composition_guide"]in Python.Vue (1186) and Angular (548) test suites pass, and the new tests fail without the source change.
fix(a2ui-renderer): omit component schemas from catalog context when …
fix(a2ui): omit component schemas from catalog context when includeSc…