Stop button doesn't terminate streaming responses (all providers, all formats)
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
What happens
Pressing Stop during a streaming response does not stop the generation. The UI stays in "thinking" mode. It shows "Cannot rewind while a prompt is running." Pressing Stop repeatedly has no effect.
If I close and reopen the session, ZCode resumes the incomplete generation. It hangs again.
What I expected
Stop should terminate the current request immediately. Then I can rewind or edit. Claude Code behaves this way.
How to reproduce
- Use any streaming provider. I tested with:
- DeepSeek-V4-Pro (custom
anthropickind, direct) - Custom Anthropic-compatible LiteLLM proxy (custom
anthropickind) - The same proxy with
openaikind and/v1/chat/completions
- DeepSeek-V4-Pro (custom
- Send a prompt that generates a multi-second streaming response.
- Press Stop during the generation.
All three fail the same way.
What I investigated
I instrumented my proxy with TCP-level logging. When I press Stop, ZCode closes the TCP connection within 1-4 seconds. I see EOF on the socket immediately. The proxy detects the disconnect and cancels the upstream request. Everything works on the proxy side.
The problem is ZCode does not transition its internal state to "done" when the connection closes. ZCode seems to wait for a stream termination event that never arrives, because the connection is already dead.
Environment
- ZCode 3.3.0 (Windows 10)
- Also reproduced on 3.2.5
Possibly related
- #89 - another case where ZCode does not clean up after itself (MCP processes)
- #93 - another issue with OpenAI-compatible provider handling (token stats)
- #96 - another custom provider config issue
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
No source files or tests are named. Start by tracing the Stop action and streaming request lifecycle for the tested Anthropic-compatible and OpenAI-compatible provider paths, then verify that a connection close reaches a terminal state and permits rewind or editing. Done means Stop immediately ends generation without leaving the UI in thinking mode.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100