feat(sdk): auto-inject A2UI tool in CopilotKitMiddleware#5161
Merged
Conversation
ranst91
requested review from
jpr5,
marthakelly,
mme and
tylerslaton
as code owners
June 2, 2026 13:00
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ranst91
force-pushed
the
feat/copilotkit-middleware-auto-a2ui
branch
from
June 2, 2026 15:16
9ca10ce to
2eeff4d
Compare
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkitnext/angular
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-inspector
commit: |
Contributor
|
Size Change: 0 B Total Size: 981 kB ℹ️ View Unchanged
|
ranst91
force-pushed
the
feat/copilotkit-middleware-auto-a2ui
branch
from
June 3, 2026 10:21
2eeff4d to
002a7e6
Compare
Contributor
Production Digest-Pinning AuditAll 27 services digest-pinned. Run 2026-06-04 10:17:14 PDT — 0 finding(s). |
Prebuilt agents get dynamic A2UI with no extra wiring — adding the middleware is enough. When the frontend registers an A2UI catalog (surfaced by the runtime into state["ag-ui"].a2ui_schema), the middleware infers the agent's own model, advertises the generate_a2ui tool in the model-call hook, and executes it in the tool-call hook. No catalog → the tool is never advertised. Covers both @copilotkit/sdk-js and the copilotkit Python SDK. Bumps the A2UI tool-factory dependency to where get_a2ui_tools ships (@ag-ui/langgraph 0.0.35, ag-ui-langgraph >=0.0.37).
The auto-injected generate_a2ui tool now resolves the A2UI catalog from both delivery paths: the CopilotKit runtime proxy (a copilotkit.context entry) and the AG-UI native endpoint (state["ag-ui"].a2ui_schema). The registered catalog id is extracted and bound to generated surfaces so BYOC custom catalogs render their own components instead of the basic catalog. Covers @copilotkit/sdk-js and the copilotkit Python SDK.
The declarative-gen-ui demo across the three langgraph integrations now relies on the middleware to inject and execute generate_a2ui — the agents collapse to create_agent + CopilotKitMiddleware with no hand-rolled tool. Adds render_a2ui fixtures for the new tool path and pins the integrations to the A2UI alpha SDKs (copilotkit 0.1.94a1, @copilotkit/sdk-js 1.59.3-alpha.1).
…=0.0.37 langgraph-fastapi bumped ag-ui-langgraph[fastapi] 0.0.35->0.0.37 (auto-A2UI needs get_a2ui_tools). Both non-exact, so the FAIL count stays 63 but the FAIL-set hash shifted. Update validatePinsFailHash to the new set.
declarative-gen-ui moved to the CopilotKitMiddleware auto-A2UI path across the 3 langgraph integrations. The middleware's inner forced tool is render_a2ui, so each integration's gen-ui-declarative.json gained 4 render_a2ui fixtures that share match keys with the pre-existing render_a2ui entries in that integration's render-a2ui.json (the a2ui_fixed demo). 4 pills x 3 integrations = 12. Same-context cross-demo overlap, disambiguated at runtime by the probe fixtureFile.
The A2UI middleware (@ag-ui/a2ui-middleware) forwards injectA2UITool on forwardedProps; ag-ui-langgraph surfaces it into agent state at state["ag-ui"]["inject_a2ui_tool"]. The CopilotKit LangGraph middleware (py + js) now reads that flag and only injects generate_a2ui when it is truthy (opt-in), drops the runtime's render_a2ui so the model sees one A2UI tool, and skips if the agent already defines generate_a2ui. The catalog only binds surfaces; it is no longer the gate. Reverts the earlier runtime-forward + context-channel approach. Deps: ag-ui-langgraph>=0.0.38 (py), @ag-ui/langgraph 0.0.37 (sdk-js), @ag-ui/a2ui-middleware 0.0.6 + @ag-ui/langgraph 0.0.37 (runtime); .npmrc min-release-age exclude for @ag-ui/a2ui-middleware. Showcase langgraph pins bumped to copilotkit==0.1.94a3 / sdk-js 1.59.3-alpha.3 / @ag-ui/langgraph 0.0.37.
ranst91
force-pushed
the
feat/copilotkit-middleware-auto-a2ui
branch
from
June 4, 2026 16:37
74256d4 to
3ca0f19
Compare
tylerslaton
previously approved these changes
Jun 4, 2026
…seline pins - Regenerate fastapi/typescript/ts-agent package-lock.json so npm ci matches package.json (@ag-ui/langgraph 0.0.37); fixes build-check. - Bump validate-pins fail-baseline hash for the langgraph-fastapi ag-ui-langgraph >=0.0.38 floor (count unchanged at 63).
tylerslaton
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prebuilt agents get dynamic A2UI with no extra wiring — adding the middleware is enough. When the frontend registers an A2UI catalog (surfaced by the runtime into state["ag-ui"].a2ui_schema), the middleware infers the agent's own model, advertises the generate_a2ui tool in the model-call hook, and executes it in the tool-call hook. No catalog → the tool is never advertised.
Covers both @copilotkit/sdk-js and the copilotkit Python SDK. Bumps the A2UI tool-factory dependency to where get_a2ui_tools ships (@ag-ui/langgraph 0.0.35, ag-ui-langgraph >=0.0.37).