Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Chat hangs on "Waiting model" when LLM stream stalls - STOP cannot interrupt blocked I/O

未关闭
#279 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
clojure
领域
backend

调研方向

Start by reading chat.clj, llm_api.clj, and the streaming provider files to trace how STOP is handled and where each provider reads the response stream. The issue proposes storing the stream for cancellation; verify how that fits the existing callbacks and error handling. Done means STOP cancels a stalled stream, returns chat to idle, and allows a new message.

由索引模型根据 Issue 内容生成。

描述

bug

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

This ticket has been created by ECA. There is currently no known way how to reproduce this bug. It just randomly appears (with no error) so I asked Claude to find out what is going on ;-)

Describe the bug
When an LLM provider's streaming response stalls (server keeps connection open but stops sending data), the chat gets
stuck on "Waiting model" indefinitely. Clicking STOP does not recover the chat. Attempting to shut down ECA also
fails with "Timeout while waiting for response. Method: shutdown".

Root cause: .readLine() on the response InputStream blocks forever. STOP sets a :stopping flag, but this flag is only
checked in callbacks that fire after .readLine() returns. Since it never returns, the flag is never checked.
Thread.interrupt() does not work on blocking java.io streams.

Affects all streaming providers (openai_chat, anthropic, ollama, openai).

To Reproduce (not sure if possible)
Steps to reproduce the behavior:

  1. Start a chat with any streaming LLM provider
  2. Send a message
  3. Have the LLM server stall mid-stream (keep connection open, stop sending data)
  4. Observe chat stuck on "Waiting model"
  5. Click STOP - chat remains stuck
  6. Try to stop ECA - get "Timeout while waiting for response. Method: shutdown"

Expected behavior

  • Clicking STOP should immediately cancel the request and return chat to idle state, allowing new messages to be sent.
  • There should be some timeout (180s?) on streaming response

Additional context
Proposed fix: Store the response InputStream when streaming starts, close it when STOP is pressed. Closing the stream
causes .readLine() to throw IOException, which is already handled via on-error.

Implementation:

  1. Add cancel-stream* atom to callbacks, store in chat state
  2. Each provider stores body (InputStream) in the atom before reading
  3. prompt-stop closes the stream via the atom

~10 lines across chat.clj, llm_api.clj, and each provider file.

主要语言
Clojure
星标
1k
派生
82
平均合并
1 天 14 小时
30 天内合并 PR
16

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

editor-code-assistant/eca 的其他 Issue

查看 editor-code-assistant/eca 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。