Files
apes-sidebar/tests
ZinChl e38aa56fec fix(tasks): 会话「驻留」不再当作「agent 在跑」——崩溃重启后的子代理状态(#800)
宿主目录行的 `activity` 是**会话驻留**而非运行态(宿主自己的字段注释:
"recursive catalog listing observed a resident Session … does not encode a
durable outcome or guarantee continuation delivery")。崩溃重启后,DSH 打开
被中断子会话的历史流会把它 prepare → retain → attach 成驻留 Session,但不会
启动 agent,于是 `activity === 'running'` 成立、卡片显示「运行中」并附带实时
预览行,而实际上没有任何东西在跑。

权威运行位其实早就在手边:会话摘要的 `running`(根卡片已经在用,
`subagent-lineage` 统计后代也在用,DSH 官方子代理下拉同样用它)。改为
「摘要的 running 优先、目录标志兜底」:

- `src/client/tasks-model.ts`:子节点 activity/state 由
  `summary.running ?? (view.running === true)` 决定。摘要没有该字段的老宿主
  继续走目录标志,行为不变。
- `src/client/team-projection.ts`:同一规则(原先恰好相反,优先了驻留标志)。

测试:
- `tests/tasks-page.spec.tsx` 新增两条:驻留但未运行 → 不是 running 卡片
  (旧代码下断言 `data-running` 为 null 会红);摘要无 running 字段 → 回落到
  目录标志(旧行为保留)。同时把两条既有用例的 fixture 修正为两路一致
  (原先 live 说 running、摘要说 false,本身自相矛盾)。
- `tests/team-projection.spec.ts` 新增两条:摘要 false + live true → idle;
  摘要 true + live false → running。
2026-09-30 02:24:36 +08:00
..
2026-09-09 11:15:30 +08:00