Repository navigation
Conversation
…sports Two new features show CopilotKit's generative UI: the agent answers with A2UI 1.0 from the standard catalog, either inside ```a2ui fences in its reply (markdown) or through the render_ui tool the CopilotKit runtime adds (tool). CopilotKit sends the guide and the component schema as context entries, so an integration needs no agent code as long as its adapter puts RunAgentInput.context into the prompt. The demos are enabled for the Claude Agent SDK (Python and TypeScript), whose adapters inject the context into the system prompt; both reuse the plain chat agent. The runtime route turns generativeUI on for the tool demo. The e2e fixtures answer only when the guide reached the model's system prompt, so a passing test proves the injection. The specs check the surface renders, that the slider and its bound total work without a round trip, and that nothing fell back to an error. The dojo pins @copilotkit/* to the pkg.pr.new previews of CopilotKit PR standard catalog's Map loads. Re-pin to a release before merging.
…lare Agents These adapters already forward RunAgentInput.context to the model, so the generative UI demos reuse each integration's plain chat agent: - AWS Strands (Python and TypeScript): a transient before-model hook - AG2: the system prompt - Agno: the run's message context - Cloudflare Agents: the system prompt The fixtures now look for the guide in any message of the request, since adapters place the context differently; it can only be there if the adapter forwarded it. Verified locally for Strands (both), AG2 and Agno on both transports; Cloudflare Agents runs in its CI lane (its existing demos need wrangler's Worker environment).
CopilotKit's LangGraph middleware already writes the run's context into the prompt, so the agentic_chat graph serves both demos. The middleware appends its context as a system message after the latest turn, so the fixtures now skip trailing system messages when they look for the user's prompt.
Pydantic AI's AGUIAdapter does not pass RunAgentInput.context to the model, so a generative_ui route reads it from the run input and hands it to the agent as instructions.
The AG-UI bridge puts RunAgentInput.context on Mastra's request context under "ag-ui". A generative_ui agent, registered in both Mastra instances, appends those entries to its instructions.
The middleware stores RunAgentInput.context in session state under CONTEXT_STATE_KEY. A generative UI agent's instruction provider appends it.
The bridge stores RunAgentInput.context in session state under AG_UI_CONTEXT_KEY. A generative UI agent's instruction provider appends it; the dojo factory now accepts an instruction provider.
…lows The endpoint puts RunAgentInput.context in the flow state. A generative UI flow appends it to its system prompt and serves both demos, with a route per feature so the route tables keep mirroring the feature names.
chainFn receives the run's context; a second chain writes it into a system message. (The adapter's model+prompt pattern would do this itself, but its system message is not a coercible message-like, so LangChain rejects it.)
The dojo server's endpoints can opt in to writing RunAgentInput.context into the system prompt; a generative_ui route does, for both demos.
A delegating agent recovers the RunAgentInput from the chat options and prepends its context, as the shared state demo does with the state.
@ag-ui/a2a-middleware
@ag-ui/a2ui-middleware
@ag-ui/event-throttle-middleware
@ag-ui/mcp-apps-middleware
@ag-ui/mcp-middleware
@ag-ui/a2a
@ag-ui/adk-js
@ag-ui/adk
@ag-ui/ag2
@ag-ui/agno
@ag-ui/antigravity
@ag-ui/aws-strands
@ag-ui/claude-agent-sdk
@ag-ui/claude-managed-agents
@ag-ui/crewai
@ag-ui/langchain
@ag-ui/langgraph
@ag-ui/llamaindex
@ag-ui/mastra
@ag-ui/pydantic-ai
@ag-ui/vercel-ai-sdk
@ag-ui/watsonx
@ag-ui/a2ui-toolkit
create-ag-ui-app
@ag-ui/client
@ag-ui/core
@ag-ui/encoder
@ag-ui/proto
commit: |
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.
Summary
Two new dojo demos for CopilotKit's generative UI (A2UI 1.0). Each has an e2e spec per lane.
```a2uifences in its reply.render_uitool.Both demos depend on one thing: the adapter has to put
RunAgentInput.contextinto the model's prompt.agentic_chatalready gets the contextinstructionsinstructionsreadrequestContext.get("ag-ui")state.contextto its system promptchainFnthat writes the context into a system messageTryGetRunAgentInputThe
@copilotkit/*packages are pinned to pkg.pr.new previews of CopilotKit/CopilotKit#7819 (commit 47deca0). The dojo now also depends onmaplibre-gl: it's an optional peer, but Next fails the build without it.Evidence
One spec per lane, run on both transports. It sends "Show me a team plan picker", and aimock answers with a plan picker only if the guide is in the request. The spec then checks:
the surface renders
the "Seats" slider shows "5 seats selected"
ArrowRight changes it to "6 seats selected"
no render error appears
Before: no generative UI demos.
After (locally, against aimock): 34 of 34 pass across 17 lanes.
Cloudflare Agents isn't covered locally: its worker doesn't run here, and its existing agentic chat spec fails locally too. Its CI lane will verify it.
The CrewAI route tests and
crewai.test.tsare updated and pass.Merge Danger
Door: two-way
Do not merge before CopilotKit releases these packages. The preview pins must first be replaced with a released version.
Blast Radius: dojo
Each lane gets two new menu entries and two new specs. The other changes are additions to example servers; no published package changes. One shared fixture now skips system messages after the user's turn: CopilotKit's LangGraph middleware puts its context message there.
Not included, with the reason for each:
copilotkit.context. Filling it makes the guide reach the model, but it changes the golden event traces. It also moves CopilotKit's context message after tool results, which breaks the existing frontend-tool specs. That needs its own change.