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
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.
概要
桌面端「会话统计 → Token 用量」面板只统计当前会话自身的 LLM 调用。通过
subagent/spawn_teammate派生的子代理在独立会话中记账,其消耗完全不出现在父会话的统计里,也看不到任何「含子代理」的合计。
对会派生多个 teammate 的工作流,这个数字会系统性低估一个 turn 的真实花费。
看起来像完整用量、实际只是局部用量 —— 建议按 UX 缺陷 / 改进处理。
复现与精确对账
spawn_teammate派一个子代理跑一段(本例 44 次模型调用)。Token 用量三个分项。~/.dsh/llm-metrics/calls.jsonl(每条含 sessionId / inputTokens /cacheReadTokens / outputTokens)按 sessionId 分别累加。
但不进入父会话统计。
session-title的调用也不计入,面板只累计agent-loop。期望行为
子代理消耗由父会话触发,应在父会话统计中可见,例如:
tokenUsage投影提供 children 汇总(系统已有 parentSessionId / childSessionId)。至少在 UI 上明示该数字是「本会话」口径,避免被当成总消耗。
相关位置(0.2.2-rc.1)
@deepseek-ai/dsh-client-ui-chat/lib/client.js:会话统计用useProjection("tokenUsage")渲染。tokenUsage是单 session 投影{uncachedInputTokens, cacheReadTokens, outputTokens}。parentSessionId/childSessionId,父子关系可用,只差汇总。环境
注:面板仅展示,不影响实际计费;问题是成本可观测性。
All reactions