CopilotKit / CopilotKit/CopilotKit
🐛 Bug: inconsistent behavior when interrupting message streams between agent mode (using LangGraph Python) and direct LLM mode
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 4.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 444
Description
♻️ Reproduction Steps
I've noticed inconsistent behavior when interrupting message streams between agent mode (using LangGraph Python) and direct LLM mode:
-
Agent Mode (LangGraph Python):
When I interrupt a streaming response and immediately send a new message, there's no response
After waiting a while and sending another message, both the previously cancelled reply and the new reply appear together
The interrupted message doesn't seem to be properly cancelled
This can be reproduced using the Research Canvas demo: https://www.copilotkit.ai/examples/canvas-research -
Direct to LLM Mode:
When I interrupt a streaming response and immediately send a new message, it responds immediately with the latest message
Works as expected
✅ Expected Behavior
How can I make agent mode behave consistently with direct LLM mode when handling message interruptions? Is there a configuration or implementation pattern I should follow to ensure interrupted agent requests are properly cancelled and new messages are processed immediately?
❌ Actual Behavior
https://www.copilotkit.ai/examples/canvas-research
https://github.com/user-attachments/assets/987fabc4-fff3-4e5a-98b7-b41847cbe2b4
𝌚 CopilotKit Version
demo used https://www.copilotkit.ai/examples/canvas-research
pnpm list --depth=0 | findstr /i "@copilotkit"
@copilotkit/runtime 1.10.2
@copilotkit/runtime-client-gql 1.10.2
@copilotkit/shared 1.10.2
📄 Logs (Optional)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the interruption sequence in the Research Canvas demo linked in the issue, using CopilotKit 1.10.2 and inspecting the @copilotkit/runtime, @copilotkit/runtime-client-gql, and @copilotkit/shared packages. Compare agent-mode streaming with direct-to-LLM mode and trace what happens after cancellation. Done means an interrupted agent response is cancelled and a new message is processed immediately without the old reply appearing later.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- ai, api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100