You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Store snapshot activity: running means the logical record is live in ctx.sessions; inactive means it exists only in persistence. Neither encodes a durable outcome, and a continuable child may still reject delivery as an ownership conflict."
list-children.ts:49–55 明确"Neither encodes a durable outcome";
README.md@ui-subagent/README.md:33 已登记为已知限制:"The catalog has no durable outcome — activity and timing do not distinguish completion, failure, or cancellation, and the UI exposes no Activation identity…"。
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Status: 用户报告的子代理会话状态显示问题
现象
用户在 DSH Web GUI 中发现,部分子代理会话"没有正常结束"但仍然显示为绿色,与"正常完成"的会话视觉上无法区分。
ready状态(定义为:仅存在于存储中、可send_message续接、非终态、不是等待收集的结果),1 个 running。ready/ 未正常结束(中断、取消、失败、仅存档)的会话,其状态圆点被渲染为绿色(done),与真正完成的会话相同。环境
deepseek-ai/deepseek-harness(商品 idR_kgDOT3T1gw)47f943859b(Merge pull request #2519 from deepseek-harness/feat/npm-public)状态模型现状
数据层
activity字段只区分 running / inactive,不含终态结局。packages/subagent/subagent/src/list-children.ts(第 49–55 行,SubagentListEntry的 JSDoc):即
list_agents/ catalog 只告诉 GUI "该记录当前是否在内存中活跃",并不说明该会话是否完成、失败还是被中断/取消。模型面
list_agents工具的状态枚举(running / idle / ready):packages/subagent/tool-subagent-control/src/list-agents.ts(第 52–63 行):running= 有活跃 driver;idle= 常驻 Agent 两次 turn 之间;ready= 仅存在于存储中,"resumable, not terminal, and not a result waiting to be collected"(可续接、非终态)。注意
ready不是终态,但它(连同任何未正常结束的会话)在 GUI 中都会落到inactive分支。Web 客户端把 host 侧驱动状态折叠成二元
inactive:packages/client/runtime/src/client/sessions/manager.ts(第 928–946 行,updateCatalogActivity;第 930 行const activity = running ? 'running' : 'inactive')—— 任何 disengage(含中断/取消/存档)都变成inactive,没有failed/aborted/interrupted通道传给 UI。状态 → 颜色映射(组件 + 行号)
核心渲染:
packages/client/ui-subagent/src/client/SubagentCatalogAction.tsx第 348 行:running→ongoing(蓝色追逐动画)done(绿色) —— 包括正常完成、中断、失败、取消、仅存档(ready)。同文件内其它同样映射:
<StateDot state={summary.running ? 'ongoing' : 'done'} />{descendants.runningCount > 0 && <StateDot state="ongoing" />}(无 running 子代理时完全不显示绿/蓝点)颜色令牌:
packages/client/ui-primitives/src/StateDot.module.css[data-state='done']→var(--dsw-alias-state-success-primary)(绿)[data-state='ongoing'](matrix 动画)→var(--dsh-state-ongoing)(DeepSeek 蓝)[data-state='error']→ 红;目录渲染中从未使用(catalog 只传ongoing/done两个值)StateDot.tsx第 10 行语义:绿色看齐done,error(红)对应失败。红/失败态在整个 subagent 目录里是"不可达"的。父行侧栏:
packages/client/ui-workspace/src/client/rows/Rows.tsx第 253–259 行 —— 非 running 的会话显示绿色done(status.running外,completed与idle均为done/绿),与上述问题一致地放大了"非活跃即绿"的暗示。根因分析(按可能性排序)
数据层
activity枚举缺失终态completed/failed/aborted,ready/未正常结束与"完成"在同一inactive桶。list-children.ts:49–55明确"Neither encodes a durable outcome";README.md@ui-subagent/README.md:33已登记为已知限制:"The catalog has no durable outcome — activity and timing do not distinguish completion, failure, or cancellation, and the UI exposes no Activation identity…"。GUI 把所有非 running 条目映射为绿色
done(SubagentCatalogAction.tsx:348)。running ? 'ongoing' : 'done'两个分支,把「未正常结束 / 仅存档」与「正常完成」渲染成同一种绿色,error(红)态在目录中永远走不到。中断(interrupt)后的会话状态没有传导到 UI。
manager.ts:930把任何 disengage 折叠为inactive,没有failed/aborted/interrupted枚举值到达 catalog;StateDot已具备error/warning语义,但目录渲染从不使用,说明中断/失败信息的管线在其到达前端之前就丢失了。(三者本质上是同一问题的三个层次:状态空间定义、UI 取色分支、中断事件传播。)
期望行为
终态 / 非终态 / 失败应可区分显示,让用户能分辨"真正完成"与"未正常结束 / 仅存档":
completed(正常完成)→ 绿色done(现状)running→ 蓝色ongoing(现状)ready(仅存档、可续接、非终态)→ 灰色/存档色,例如复用warning之外的--dsw-*中性 token,或用不同图标,避免被误读为"完成"failed(失败/报错)→ 红色error(StateDot已有语义但目录未用)aborted/interrupted(被用户或父代中断)→ 中性的明显区分色 / 标签(如 amberwarning或独立图标)建议
subagentTiming/ 新的 projection 或SubagentListEntry上增加outcome/terminal字段),来源建议subagent/descriptor与turn/end(stopReason: completed/aborted/max-tokens/error/disposed,参见agent-loop/subagent-dsh-sdk的终态映射惯例)。SubagentCatalogAction.tsx:348由二分running/inactive扩展为running → ongoing、completed → done、ready → neutral/archive、failed → error、aborted → warning/neutral;同时把error状态真正路由到StateDot。manager.ts保留failed/aborted/interrupted的到达通道,避免 disengage 即塌缩为inactive。ui-subagent/README.md:33的已知限制条目(一旦实现),并补充组件级快照/单测覆盖各结局颜色的渲染。未确认项
pnpm run test:gui/ 实机 GUI 复现(只读调研,不做改动)。ready视觉方案(灰/存档色 vs 独立徽标)等待维护者/设计定夺。interrupt后 host 是否已在turn/end写入stopReason: 'aborted'、以及该信息目前未到达list-children的细节,须结合 host 侧持久化/广播实现进一步核对(未在此只读调查中逐文件验证)。All reactions