Files
Jiayuan Zhang 6fc9ce2724 fix(chat): differentiate stuck-queue states from a healthy queue
When a user's local daemon is offline or stops claiming tasks, the chat
StatusPill used to sit on "排队中" / "Queued" indefinitely with no clue
that anything was wrong (GH #2341). The runtime sweeper takes ~150s to
flip runtime.status, and even when it does the only diagnostic was a
single-word "Offline" label.

- Add a STUCK_THRESHOLD_SECS=30 escalation: queued/dispatched past 30s
  now renders a static "Daemon not responding" / "Daemon 无响应" stage
  even when availability still reports online — covers the sweeper-lag
  window and the heartbeating-but-not-claiming edge case.
- Rename the offline-stage label to "Runtime offline" / "Runtime 离线"
  so it points at the actual failure surface instead of the agent.
- Append a `multica daemon logs -f` diagnostic hint to the offline
  banner so users have a concrete next step.
- Extract pickStageKeys for testing and add unit coverage for the new
  stuck-detection branches and the "offline always wins" precedence.

Co-authored-by: multica-agent <github@multica.ai>
2026-05-10 14:40:38 +08:00
..