Bug: assistant text emitted after a tool call in the same run never reaches the v1 client
♻️ Reproduction Steps
- Configure a v1-style CopilotRuntime with agents: { default: ... } (custom BuiltInAgent subclass or any agent) whose response includes text, then a tool call, then more text, all in the same run.
- Trigger a chat interaction producing that text → tool call → text pattern.
- Observe the rendered message in the v1 (useCopilotChat) client.
✅ Expected Behavior
Both text segments (before and after the tool call) should render as one continuous assistant message, matching the full AG-UI event stream.
❌ Actual Behavior
Only the first text segment renders. The server-side AG-UI stream itself is complete and correctly ordered — verified via full per-event server-side tracing: TEXT_MESSAGE_START/CONTENT/END, TOOL_CALL_START/ARGS/END, a second TEXT_MESSAGE_START/CONTENT/END, then RUN_FINISHED with no error. Nothing is dropped upstream of the v1-compat translation layer.
Working hypothesis, after ruling out three other candidates: the v1-compat bridge treats TOOL_CALL_START as "this turn is done" and stops forwarding further text content for the same run.
Note: diagnosed against @copilotkit/[email protected]'s compiled output, not current TypeScript source, so I don't have a precise file:line citation for current main the way I did for the clone() bug above. Happy to help narrow it down if a maintainer can point at the relevant file (likely something translating AG-UI events into the v1 GraphQL message stream).
Screenshots
No response
CopilotKit Version
backend:
├── @ag-ui/[email protected]
├── @copilotkit/[email protected]
frontend:
├── @copilotkit/[email protected]
├── @copilotkit/[email protected]Logs (Optional)
Source: CopilotKit/CopilotKit