CodeWhale icon indicating copy to clipboard operation
CodeWhale copied to clipboard

TUI busy state can become stale when dispatch/turn lifecycle state diverges

Open Oliver-ZPLiu opened this issue 6 months ago • 1 comments

Description

The TUI busy state can become stale if the frontend enters is_loading = true but the expected turn lifecycle does not progress or later becomes inconsistent.

This is related to the stale working... class of issues from #738, but it is broader than the original dispatch-failure path. It can leave the composer treating later input as pending input even when no active task is shown.

Steps to reproduce

  1. Start an interactive TUI session.
  2. Submit a prompt so the UI enters a busy/loading state.
  3. If dispatch or turn lifecycle state becomes inconsistent, the footer can remain working... while later prompts are queued as pending input.

Expected behavior

The TUI should self-heal stale busy states when no active turn, agent, or compaction is running.

Actual behavior

The UI can remain in a stale busy state, causing later composer input to be queued instead of submitted normally.

Environment

  • OS: Windows 11
  • DeepSeek CLI version: v0.8.20
  • Model: deepseek-v4-pro
  • Shell: Windows Terminal / cmd / PowerShell

Proposed fix

Add a small UI-side watchdog/reconciliation layer.

Suggested narrow implementation:

  • Track dispatches that have not yet observed TurnStarted.
  • Clear that marker on turn start, turn completion, cancellation, engine error, or send failure.
  • Reconcile stale/impossible states in the TUI event loop when no turn, agent, or compaction is active.
  • Show a short recovery toast/status note.

This avoids a larger AgentHook/generator-style lifecycle refactor.

Oliver-ZPLiu avatar May 08 '26 07:05 Oliver-ZPLiu

重复提交了,和issue #1159 一样。

Oliver-ZPLiu avatar May 08 '26 07:05 Oliver-ZPLiu