Skip to content

Error message not cleared after switching model and sending new request #2105

@yiliang114

Description

@yiliang114

What happened?

After an API request fails, switching the model and sending a new message does not clear the previous error message. It remains displayed on the interface.

Image Image

Steps to reproduce:

  1. Send a request that triggers an API error (e.g., quota exceeded, model unavailable)
  2. The error message is displayed with "Press Ctrl+Y to retry" hint
  3. Use /model command to switch to another model
  4. Send a new request, which succeeds this time
  5. The previous error message is still visible and was not cleared

Root cause:
In useGeminiStream.ts, the submitQuery function has incomplete condition check when clearing old errors:

// Problematic code (line 1084)
if (pendingRetryCountdownItemRef.current) {  // Only checks countdown, not error
    clearRetryCountdown();
}

When the error does not trigger an auto-retry countdown (only showing a static "Press Ctrl+Y to retry" hint), pendingRetryCountdownItemRef.current is null, so clearRetryCountdown() is never called.

What did you expect to happen?

When switching models and sending a new message, the previous error message should be cleared, and only the new request result should be displayed.

Client information

Client Information
$ qwen /about

  ╭──────────────────────────────────────────────────────────────────────────────────────╮
  │                                                                                      │
  │ 状态                                                                                 │
  │                                                                                      │
  │ Qwen Code                    0.11.0 (a31cf757)                                       │
  │ 运行环境                     Node.js v22.22.0 / npm 10.9.4                           │
  │ IDE 客户端                   VS Code                                                 │
  │ 操作系统                     darwin arm64 (24.1.0)                                   │
  │                                                                                      │
  │ 认证                         openai (custom endpoint)                                │
  │ 模型                         pai/glm-5                                               │
  │ 会话 ID                      7dbaf372-8d51-4f23-a9bd-ade69279f7b4                    │
  │ 沙箱                         no sandbox                                              │
  │ 代理                         no proxy                                                │
  │ 内存使用                     275.3 MB                                                │
  ╰──────────────────────────────────────────────────────────────────────────────────────╯

Login information

Using OpenAI compatible API endpoint.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions