makecindy / makecindy/cindy

Bug: Claude Code status bar stays on background-tasks-running after the session is idle

Open
#3,063 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: 匿名
**客户端版本**: 0.1.56

---

## 现象

Claude Code 会话的主对话已结束,向模型查询也确认没有后台任务在跑,但状态栏仍显示「后台任务运行中」。两边状态不一致。

## 复现步骤

1. 用 Claude Code 开一个会话,让模型启动多个 Explore 类子 agent 做并行调研。
2. 等子 agent 完成,主对话输出完整结论。
3. 再问「现在有没有后台任务在跑」,确认没有。
4. 观察输入框上方状态栏是否仍显示「后台任务运行中」。

## 期望行为

4e3b turn 结束、子 agent 全部完成后,状态栏应消失「后台任务运行中」。界面运行态应与会话真实运行态一致。

如果终态事件丢失,应通过快照对账把残留 running 记录收口为已停止,而不是一直保持「在跑」。

## 实际行为

4e3b对话已停,模型回答也说没有后台任务在跑,但状态栏仍显示「后台任务运行中」。

## 复现频率

曾经出现过,本次确认到,尚未另复测。

## 已尝试

- 向该会话再问是否还有后台任务:模型回答没有在跑。
- 用会话运行态探针核对:主 turn 已结束、无排队、无活跃 turn。

## 脱敏诊断摘要(经用户同意公开)

- 会话运行态探针:`phase=completed`,`active=false`,`queuedCount=0`。
- 该轮只启动过 2 个 Explore 子 agent,均已完成并写进结论;没有未完成的 `run_in_background` Bash。
- 状态栏「后台任务运行中」对应的是主 turn 已结束后仍被认为有 `taskType=local_bash` 且 `status=running` 的本地记录,而不是当前主 turn 还在跑。
- 可疑收口缺口:`listSessionBackgroundTasks` 只查当前活着的 session handle;主对话结束后该接口返回空数组。空快照在部分路径会被当成「没有对账信息」直接忽略,导致前端 stale running 不被清掉。
- 结果:模型按任务列表说「没在跑」,界面按本地 taskUpdates 残留记录显示「在跑」。

> 本报告未包含账号、令牌、邮箱、个人文件路径、原始对话内容或无关日志。
---
**版本区域**: CN
**OS**: win32 x64 (10.0.26100)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by tracing listSessionBackgroundTasks and the taskUpdates state used by the status bar, focusing on the path where an empty snapshot is ignored after the session ends. Reproduce the completed-session case with two finished Explore agents, then verify that stale local_bash records no longer keep the status bar visible when the snapshot reports no active tasks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.