Moves: v1.1 → v1.0(2026-09-29) ## Decision context 1.0 只做 token 用量(不做金额);记账政策:凡可见且计费的调用都计入其所属 PersonaBot 并记录 purpose;unowned Session 不进任何 bot 的图表。本票产出「哪些调用可计费 / 可见」的核对表,以及明确无法追溯的缺口;实现由 #428(Profile T4)承接,DSH 侧优先复用 `deriveTurnTokenUsage`(覆盖 `assistant/message` 与 `assistant/attempt` stream usage)。 --- ## Question DSH 的 session 日志是否覆盖全部可计费调用:`assistant/attempt`(失败重试)与 `assistant/message`(结算)、压缩 / 自动标题等系统调用、运行在子 session 的 subagent / fork——各自是否出现在可查询日志里、如何归属。 ## 需要产出 - "哪些调用可计费 / 可见"的核对表(含 `sessionQuery` 读取路径) - 明确无法追溯的缺口(若有)
Activity
DoodleBears commentedon Sep 28, 2026
Verified checklist (2026-09-29, DSH 0.2.0-rc.1)
以 pinned DSH 类型与本地包核对(
dsh-token-meter/lib/types/usage-projection.js、turn-usage.d.ts、dsh-session/lib/types/types.d.ts、dsh-llm/lib/types/assistant-stream.d.ts):assistant/message(结算)data.usage: TokenUsage(input/output/cacheRead/cacheWrite 四桶,互斥;billedInput = 三输入桶之和)assistant/attempt(失败/重试/取消的尝试)data.stream最后一个 usage chunk 即该次尝试的 provider usagellm/retry/llm/retry-started标明替换关系parentSession/origin: 'subagent';fork 子日志含父前缀(inheritedEventCount)events.slice(inheritedEventCount)去重折 turn 由 DSH 导出的
deriveTurnTokenUsage(turn-local events)完成(@deepseek-ai/dsh-token-meter/client):覆盖重试替换、四桶与 provider/modelroutes;生命周期不完整时返回undefined。价格/金额 DSH 永不提供(#35 v1.1)。无法追溯的缺口:无逐调用成本;无 purpose 标记(压缩/标题与普通调用无法区分);
sessionProjections.tokenUsage只有 Session 总量(无 day/model 维度),仅作对账。实现随 #428。DoodleBears commentedon Sep 28, 2026
核对表已给出(见上);T4 实现按此口径归集与去重。