mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
0be474d562
Two bugs fixed:
1. Tool result event path: the `a2ui_operations` container was emitted
inside a `TextMessageContentEvent` block. The A2UI middleware only scans
`TOOL_CALL_RESULT` events for the container, so the card never mounted
and the raw JSON appeared as plain text in the chat. Fixed by emitting a
`ToolCallResultEvent` (matching the claude-sdk-python peer).
2. Operation shape: the ops used the legacy flat form
(`{"type": "create_surface", ...}`) which the renderer silently ignores.
Updated to the v0.9 nested form (`{"version": "v0.9", "createSurface":
{...}}`) used by every other working peer (claude-sdk-python, strands,
google-adk).
Also adds the missing langroid aimock D6 fixture for `gen-ui-a2ui-fixed`
(`display_flight` → tool result → confirmation text) so the D6 probe has
a mock response to drive the full surface-render assertion.
D6 cell: d6:langroid/gen-ui-a2ui-fixed red → green
38 lines
1.8 KiB
JSON
38 lines
1.8 KiB
JSON
{
|
|
"_meta": {
|
|
"description": "D6 fixtures for langroid / gen-ui-a2ui-fixed (a2ui-fixed-schema flight card pill)",
|
|
"created": "2026-07-07"
|
|
},
|
|
"fixtures": [
|
|
{
|
|
"_comment": "a2ui-fixed-schema pill — 'Find me a flight from SFO to JFK on United for $289.' The langroid backend calls OpenAI with the `display_flight` tool; the tool emits an a2ui_operations container (v0.9 shape) via TOOL_CALL_RESULT which the runtime A2UI middleware detects and forwards to the frontend renderer (Card renderer with data-testid='a2ui-fixed-card'). Anchored on hasToolResult:false so it fires on the initial routing turn before any tool result is observed.",
|
|
"match": {
|
|
"userMessage": "Find me a flight from SFO to JFK on United for $289",
|
|
"hasToolResult": false,
|
|
"context": "langroid"
|
|
},
|
|
"response": {
|
|
"content": "Here is the SFO to JFK flight on United.",
|
|
"toolCalls": [
|
|
{
|
|
"id": "call_a2ui_fixed_langroid_sfo_jfk_001",
|
|
"name": "display_flight",
|
|
"arguments": "{\"origin\":\"SFO\",\"destination\":\"JFK\",\"airline\":\"United\",\"price\":\"$289\"}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"_comment": "a2ui-fixed-schema pill — follow-up content after display_flight has returned its a2ui_operations container (flight card already rendered). Anchored on hasToolResult:true so it fires AFTER the tool result instead of re-routing, preventing a tool-invocation loop.",
|
|
"match": {
|
|
"userMessage": "Find me a flight from SFO to JFK on United for $289",
|
|
"hasToolResult": true,
|
|
"context": "langroid"
|
|
},
|
|
"response": {
|
|
"content": "Here's your flight: United Airlines, SFO → JFK, $289 — rendered in the card above. Tap \"Book flight\" to confirm."
|
|
}
|
|
}
|
|
]
|
|
}
|