[GH-ISSUE #5091] [GUI] 聊天输入框的斜杠菜单里没有 /compact,上下文也没有"到自动压缩还剩多少"的预警:用户只能被动等它在中途压缩 #2375

Open
opened 2026-11-04 01:58:48 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @xvcezrqpbxtpzblrt on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5091

English TL;DR: /compact already works in the app — the harness plugin dsh-command-compact is loaded by the app's own preset (apps/host/server/agent/preset.mjs:94), and the app itself sends /compact when a chat overflows (apps/host/src/lib/store.ts:1565-1571). What is missing is any way to see it coming and any way to choose it: the composer's slash menu lists nine commands and /compact is not one of them (apps/host/src/screens/Chat.tsx:545-558), and the context gauge lives inside a click-away popover (apps/host/src/components/TelemetryPopover.tsx:55) with no link to the compaction threshold. The threshold itself is a computed number the app already knows: DEFAULT_THRESHOLD_RATIO = .8 (installed harness/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js:15), thresholdTokens = floor(min(contextWindow × thresholdRatio, contextWindow − reservedCompletionTokens − headroomTokens)) (:128-132), and Strata's own comment says the effective line is "about 60 percent" (apps/host/server/agent/profile.mjs:149-153). Compaction fires only at a step boundary (...:839 agent/pre-step), which is exactly why a long turn gets compacted mid-task, with no warning. This asks for a visible entry point plus an always-visible remaining-budget warning, so the person compresses before the model runs out, not in the middle of a task.

Area

[GUI] 聊天界面(桌面版窗口内、--browser 网页模式、STRATA_UI=window 三种跑法共用同一份 Web UI)

版本行(本机安装组件)

app 0.2.10; engine 0.1.55; agent deepseek-harness 0.2.1-alpha.3; node v24.12.0; Windows 10.0.26300
GPU: NVIDIA GeForce RTX 3080 Ti Laptop (VRAM 12 GiB), 16 cores, 64 GB RAM

源码核对基准:tag v0.2.10 = ffa80d73(2026-11-03 06:37:27),与安装产物 host\dist 的 mtime 06:37:26 一致。

现象(用户视角)

  1. 长会话里,AI 正执行到一半,界面出现"正在压缩上下文",任务被切断;压缩期间界面只有一行状态,持续很久(参见 #4981 报的 4 次自动压缩、每次 7–8 分钟)。
  2. 用户事先看不到"还剩多少就要压缩了",所以没有任何机会在压缩前收住手、换会话、或主动压缩。
  3. 上下文用量其实有显示,但藏在聊天顶部统计弹层里(% of context 环 + Context used / Context limit / Space remaining),要点开,而且它显示的是"已用多少",不告诉你压缩线在哪——60% 这条线对普通用户不可见。
  4. 主动压缩的命令已经能用:在输入框里打 /compact 就压缩(Usage: /compact (no arguments))。但输入框的斜杠菜单列出的命令里没有它,所以用户不知道有这个东西,只能靠别人告诉。

现状(全部核到 v0.2.10 = ffa80d73 / 已安装产物)

事实 位置
/compact 由应用预设加载 apps/host/server/agent/preset.mjs:94 { id: 'command-compact', name: '@deepseek-ai/dsh-command-compact' }
命令用法原文 已安装 harness/node_modules/@deepseek-ai/dsh-command-compact/lib/index.js:10 const USAGE = "Usage: /compact (no arguments)";
忙的时候会给真话 同文件 :22 text: "Compaction is unavailable because this process has an active compaction, or the agent is not idle.";:26 Compaction cancelled.;:30 历史已变则记入会话日志
应用自己在溢出时发 /compact apps/host/src/lib/store.ts:1565-1571 注释 “…summarise the older messages (the same as typing /compact)…” + await sendMessage('/compact');
输入框斜杠菜单的内容(没有 /compact) apps/host/src/screens/Chat.tsx:545-558:/time-skip、/goal、/plan、/research、/loop、/website、/preview(+ 演示模式的 /subagents),再拼上 getSlashCommands();apps/host/src/lib/commands.ts 里带 slash 别名的只有 new / export / setup / tune / monitor / serve / model / tasks / skills
自动压缩的线在哪 已安装 dsh-compaction-basic/lib/index.js:15 DEFAULT_THRESHOLD_RATIO = .8;:17 DEFAULT_RETAIN_RATIO = .16;:128-132 thresholdTokens = Math.floor(Math.min(contextWindow * policy.thresholdRatio, pressureBudgetTokens)),其中 pressureBudgetTokens = contextWindow - reservedCompletionTokens - headroomTokens
Strata 只覆盖 headroom,注释自己写了实际线在 60% apps/host/server/agent/profile.mjs:151-153 compactionHeadroom(context, outputBudget) = max(512, min(65536, floor((context - outputBudget) * 0.125)));:149 注释 “…Compaction then starts at about 60 percent.”
压缩只在下个步骤开始前发生(= 用户看到的"中途") 已安装 dsh-compaction-basic/lib/index.js:839 ctx.on("agent/pre-step", … compactIfNeeded(agent, "pressure", signal))
上下文用量显示在统计弹层里 apps/host/src/components/TelemetryPopover.tsx:55:ContextRing 环 + % of context + 行 “Context used / Context limit / Space remaining”
这些数字从哪来、哪些是估的 store.ts:2009 从流帧取 contextUsed/contextMax;:2032 frame.contextTokens;:1878 估算路径 Math.ceil(len/4) 且 usageSource:'estimated';apps/host/src/lib/types.ts:351,355,478 contextUsed/contextMax/statsAvailable;apps/host/src/app/ContextPanel.tsx:27,40-41 已有 “Not available for every request” 与 “It is not a live reading of the model cache.” 的诚实标注

想要什么(4 条,都落在 GUI,不改压缩策略本身)

  1. 把 /compact 放进输入框的斜杠菜单(在 Chat.tsx:545-558 那份列表里加一项),提示语写清后果:压缩会把较早的消息收成摘要,当前任务会中断。菜单项在正在回答时禁用,并把 harness 已有的那句真话显示出来(Compaction is unavailable because … the agent is not idle.),不要让人点了才知道。
  2. 剩余额度常驻可见,并且显示的是"到压缩线还剩多少",不只是"已用百分比":把统计弹层里那条数据(% of context、Context limit、Space remaining)提到输入框上方一条常驻小条,文案形如「上下文已用 45%,到自动压缩还剩约 9,800 tokens」。压缩线用应用已知的那个数算:min(contextWindow × thresholdRatio, contextWindow − reservedCompletionTokens − headroomTokens)(上面已安装代码 :128-132),Strata 侧注释说明实际约在 60%(profile.mjs:149)。
  3. 到线前给一次可操作的提醒:达到阈值的七成(例如 42% 对应 60% 线)时提示「继续发新消息会触发自动压缩。建议现在主动压缩,或开新会话」。用户因此可以选择主动压缩,而不是任务中途被压缩。理由就在源码里:压缩只在下个步骤开始前触发(pre-step,:839),所以一个长回合跑到中途时,人是无法预先安排的。
  4. 数字要诚实:估算值(usageSource 为 estimated,store.ts:1878)必须标「估算」;statsAvailable === false 时显示「不可用」,沿用 ContextPanel.tsx:40-41 已有的写法,不给假精确数。

复现与验证状态(按 CONTRIBUTING 区分 passed / failed / not run)

  • passed(读码,标注为静态分析):/compact 已加载与应用自发 /compact(preset.mjs:94、store.ts:1565-1571);命令用法与忙时文案(dsh-command-compact/lib/index.js:10,22,26,30);斜杠菜单清单里无 /compact(Chat.tsx:545-558 + lib/commands.ts 的 slash 别名集合);阈值算法与常量(dsh-compaction-basic/lib/index.js:15,17,128-132);headroom 覆盖与 60% 注释(profile.mjs:149-153);触发时机 agent/pre-step(:839);上下文显示位置(TelemetryPopover.tsx:55)与取数/估算路径(store.ts:2009,2032,1878)
  • passed(运行时):本机安装产物与 tag ffa80d73 时间一致(host\dist mtime 06:37:26);本机版本行如上面所贴(本机实测组件信息)
  • failed:无
  • not run:没有实测"到阈值时到底压缩耗时多久、界面显示什么"。要测需要一个把上下文推到 60% 以上的长会话(本机 32K–128K 窗口下需数十轮长输出),本次未跑;上面第 3 条的"七成预警"具体比例没有实测支撑,是建议值,实现时按实测调
  • 未做端到端点击复现(我不能程序化点击/拖选应用界面),现象部分来自界面观察 + 上述代码路径

影响面

聊天界面三个跑法共用同一份 Web UI:桌面窗口、--browser 网页模式、STRATA_UI=window。本需求只动 GUI(菜单项、常驻额度条、到线提醒),不动压缩算法、不动默认值,属可关闭的界面增强,符合 CONTRIBUTING 的"新功能默认不改既有路径"。

相关已有 issue(先查过仓库,不重复)

  • #4744 [open] compaction policy: two fixed ratios decide when it runs …(阈值策略本身,含 .8 与 headroom 的算术)—— 本 issue 是它的界面可见性一侧,不改策略
  • #5011 [open] Cloud API models trigger automatic compaction too early …
  • #3998 [open] Compaction re-reads 331K-342K tokens five times (19.5-20.1 min each) …
  • #4542 [open] Codex CLI 0.165.0 repeatedly compacts context and loses task progress
  • #4981 [open] Goal 自治长程任务:4 次自动压缩(每次 7–8 分钟仅一行状态)… —— 就是本 issue 说的"中途被动压缩"的实际后果
  • #5006 [open] … breaks OpenCode auto-compaction …
  • 搜索过的关键词:compact、compress context、压缩上下文、context window 压缩、context meter、summarise older messages、token 剩余;没有覆盖"输入框暴露 /compact + 压缩线预警"的开放 issue

本报告未包含

  • 未包含:上述 not run 的实测;压缩一次的实际耗时与真实触发点(需长会话);API 云端模型路径下的额度显示精度(与 #5011 的重叠未测);多语言文案(界面 7 种语言,新文案需同步翻译,我没有译稿);移动端窄屏(max-width 断点下额度条的排版)未设计
Originally created by @xvcezrqpbxtpzblrt on GitHub (Nov 3, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5091 **English TL;DR**: `/compact` **already works** in the app — the harness plugin `dsh-command-compact` is loaded by the app's own preset (`apps/host/server/agent/preset.mjs:94`), and the app itself sends `/compact` when a chat overflows (`apps/host/src/lib/store.ts:1565-1571`). What is missing is any way to *see* it coming and any way to *choose* it: the composer's slash menu lists nine commands and `/compact` is not one of them (`apps/host/src/screens/Chat.tsx:545-558`), and the context gauge lives inside a click-away popover (`apps/host/src/components/TelemetryPopover.tsx:55`) with no link to the compaction threshold. The threshold itself is a computed number the app already knows: `DEFAULT_THRESHOLD_RATIO = .8` (installed `harness/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js:15`), `thresholdTokens = floor(min(contextWindow × thresholdRatio, contextWindow − reservedCompletionTokens − headroomTokens))` (`:128-132`), and Strata's own comment says the effective line is "about 60 percent" (`apps/host/server/agent/profile.mjs:149-153`). Compaction fires only at a step boundary (`...:839` `agent/pre-step`), which is exactly why a long turn gets compacted mid-task, with no warning. This asks for a visible entry point plus an always-visible remaining-budget warning, so the person compresses *before* the model runs out, not in the middle of a task. ## Area [GUI] 聊天界面(桌面版窗口内、`--browser` 网页模式、`STRATA_UI=window` 三种跑法共用同一份 Web UI) ## 版本行(本机安装组件) ``` app 0.2.10; engine 0.1.55; agent deepseek-harness 0.2.1-alpha.3; node v24.12.0; Windows 10.0.26300 GPU: NVIDIA GeForce RTX 3080 Ti Laptop (VRAM 12 GiB), 16 cores, 64 GB RAM ``` 源码核对基准:tag `v0.2.10` = `ffa80d73`(2026-11-03 06:37:27),与安装产物 `host\dist` 的 mtime `06:37:26` 一致。 ## 现象(用户视角) 1. 长会话里,AI 正执行到一半,界面出现"正在压缩上下文",任务被切断;压缩期间界面只有一行状态,持续很久(参见 #4981 报的 4 次自动压缩、每次 7–8 分钟)。 2. 用户事先看不到"还剩多少就要压缩了",所以没有任何机会在压缩前收住手、换会话、或主动压缩。 3. 上下文用量其实**有**显示,但藏在聊天顶部统计弹层里(`% of context` 环 + Context used / Context limit / Space remaining),要点开,而且它显示的是"已用多少",**不告诉你压缩线在哪**——`60%` 这条线对普通用户不可见。 4. 主动压缩的命令**已经能用**:在输入框里打 `/compact` 就压缩(`Usage: /compact (no arguments)`)。但输入框的斜杠菜单列出的命令里没有它,所以用户不知道有这个东西,只能靠别人告诉。 ## 现状(全部核到 v0.2.10 = ffa80d73 / 已安装产物) | 事实 | 位置 | |---|---| | `/compact` 由应用预设加载 | `apps/host/server/agent/preset.mjs:94` `{ id: 'command-compact', name: '@deepseek-ai/dsh-command-compact' }` | | 命令用法原文 | 已安装 `harness/node_modules/@deepseek-ai/dsh-command-compact/lib/index.js:10` `const USAGE = "Usage: /compact (no arguments)";` | | 忙的时候会给真话 | 同文件 `:22` `text: "Compaction is unavailable because this process has an active compaction, or the agent is not idle."`;`:26` `Compaction cancelled.`;`:30` 历史已变则记入会话日志 | | 应用自己在溢出时发 `/compact` | `apps/host/src/lib/store.ts:1565-1571` 注释 “…summarise the older messages (**the same as typing /compact**)…” + `await sendMessage('/compact');` | | 输入框斜杠菜单的内容(没有 `/compact`) | `apps/host/src/screens/Chat.tsx:545-558`:`/time-skip`、`/goal`、`/plan`、`/research`、`/loop`、`/website`、`/preview`(+ 演示模式的 `/subagents`),再拼上 `getSlashCommands()`;`apps/host/src/lib/commands.ts` 里带 `slash` 别名的只有 `new / export / setup / tune / monitor / serve / model / tasks / skills` | | 自动压缩的线在哪 | 已安装 `dsh-compaction-basic/lib/index.js:15` `DEFAULT_THRESHOLD_RATIO = .8`;`:17` `DEFAULT_RETAIN_RATIO = .16`;`:128-132` `thresholdTokens = Math.floor(Math.min(contextWindow * policy.thresholdRatio, pressureBudgetTokens))`,其中 `pressureBudgetTokens = contextWindow - reservedCompletionTokens - headroomTokens` | | Strata 只覆盖 headroom,注释自己写了实际线在 60% | `apps/host/server/agent/profile.mjs:151-153` `compactionHeadroom(context, outputBudget) = max(512, min(65536, floor((context - outputBudget) * 0.125)))`;`:149` 注释 “…Compaction then starts at about 60 percent.” | | 压缩只在下个步骤开始前发生(= 用户看到的"中途") | 已安装 `dsh-compaction-basic/lib/index.js:839` `ctx.on("agent/pre-step", … compactIfNeeded(agent, "pressure", signal))` | | 上下文用量显示在统计弹层里 | `apps/host/src/components/TelemetryPopover.tsx:55`:`ContextRing` 环 + `% of context` + 行 “Context used / Context limit / **Space remaining**” | | 这些数字从哪来、哪些是估的 | `store.ts:2009` 从流帧取 `contextUsed`/`contextMax`;`:2032` `frame.contextTokens`;`:1878` 估算路径 `Math.ceil(len/4)` 且 `usageSource:'estimated'`;`apps/host/src/lib/types.ts:351,355,478` `contextUsed/contextMax/statsAvailable`;`apps/host/src/app/ContextPanel.tsx:27,40-41` 已有 “Not available for every request” 与 “It is not a live reading of the model cache.” 的诚实标注 | ## 想要什么(4 条,都落在 GUI,不改压缩策略本身) 1. **把 `/compact` 放进输入框的斜杠菜单**(在 `Chat.tsx:545-558` 那份列表里加一项),提示语写清后果:压缩会把较早的消息收成摘要,当前任务会中断。菜单项在正在回答时禁用,并把 harness 已有的那句真话显示出来(`Compaction is unavailable because … the agent is not idle.`),不要让人点了才知道。 2. **剩余额度常驻可见,并且显示的是"到压缩线还剩多少"**,不只是"已用百分比":把统计弹层里那条数据(`% of context`、Context limit、Space remaining)提到输入框上方一条常驻小条,文案形如「上下文已用 45%,到自动压缩还剩约 9,800 tokens」。压缩线用应用已知的那个数算:`min(contextWindow × thresholdRatio, contextWindow − reservedCompletionTokens − headroomTokens)`(上面已安装代码 `:128-132`),Strata 侧注释说明实际约在 60%(`profile.mjs:149`)。 3. **到线前给一次可操作的提醒**:达到阈值的七成(例如 42% 对应 60% 线)时提示「继续发新消息会触发自动压缩。建议现在主动压缩,或开新会话」。用户因此可以选择主动压缩,而不是任务中途被压缩。理由就在源码里:压缩只在下个步骤开始前触发(`pre-step`,`:839`),所以一个长回合跑到中途时,人是无法预先安排的。 4. **数字要诚实**:估算值(usageSource 为 `estimated`,`store.ts:1878`)必须标「估算」;`statsAvailable === false` 时显示「不可用」,沿用 `ContextPanel.tsx:40-41` 已有的写法,不给假精确数。 ## 复现与验证状态(按 CONTRIBUTING 区分 passed / failed / not run) - **passed(读码,标注为静态分析)**:`/compact` 已加载与应用自发 `/compact`(`preset.mjs:94`、`store.ts:1565-1571`);命令用法与忙时文案(`dsh-command-compact/lib/index.js:10,22,26,30`);斜杠菜单清单里无 `/compact`(`Chat.tsx:545-558` + `lib/commands.ts` 的 `slash` 别名集合);阈值算法与常量(`dsh-compaction-basic/lib/index.js:15,17,128-132`);headroom 覆盖与 60% 注释(`profile.mjs:149-153`);触发时机 `agent/pre-step`(`:839`);上下文显示位置(`TelemetryPopover.tsx:55`)与取数/估算路径(`store.ts:2009,2032,1878`) - **passed(运行时)**:本机安装产物与 tag `ffa80d73` 时间一致(`host\dist` mtime `06:37:26`);本机版本行如上面所贴(本机实测组件信息) - **failed**:无 - **not run**:没有实测"到阈值时到底压缩耗时多久、界面显示什么"。要测需要一个把上下文推到 60% 以上的长会话(本机 32K–128K 窗口下需数十轮长输出),本次未跑;上面第 3 条的"七成预警"具体比例没有实测支撑,是建议值,实现时按实测调 - 未做端到端点击复现(我不能程序化点击/拖选应用界面),现象部分来自界面观察 + 上述代码路径 ## 影响面 聊天界面三个跑法共用同一份 Web UI:桌面窗口、`--browser` 网页模式、`STRATA_UI=window`。本需求只动 GUI(菜单项、常驻额度条、到线提醒),不动压缩算法、不动默认值,属可关闭的界面增强,符合 CONTRIBUTING 的"新功能默认不改既有路径"。 ## 相关已有 issue(先查过仓库,不重复) - #4744 [open] compaction policy: two fixed ratios decide when it runs …(阈值策略本身,含 `.8` 与 headroom 的算术)—— 本 issue 是它的界面可见性一侧,不改策略 - #5011 [open] Cloud API models trigger automatic compaction too early … - #3998 [open] Compaction re-reads 331K-342K tokens five times (19.5-20.1 min each) … - #4542 [open] Codex CLI 0.165.0 repeatedly compacts context and loses task progress - #4981 [open] Goal 自治长程任务:4 次自动压缩(每次 7–8 分钟仅一行状态)… —— 就是本 issue 说的"中途被动压缩"的实际后果 - #5006 [open] … breaks OpenCode auto-compaction … - 搜索过的关键词:`compact`、`compress context`、`压缩上下文`、`context window 压缩`、`context meter`、`summarise older messages`、`token 剩余`;没有覆盖"输入框暴露 `/compact` + 压缩线预警"的开放 issue ## 本报告未包含 - 未包含:上述 not run 的实测;压缩一次的实际耗时与真实触发点(需长会话);API 云端模型路径下的额度显示精度(与 #5011 的重叠未测);多语言文案(界面 7 种语言,新文案需同步翻译,我没有译稿);移动端窄屏(`max-width` 断点下额度条的排版)未设计
Author
Owner

@xvcezrqpbxtpzblrt commented on GitHub (Nov 3, 2026):

顺带一个同类的"数字看不见"的问题,供参考 —— 它跟本 issue 不是同一个主题,列在这里只为把两处可见性缺口串起来,方便一次定位。

现象:界面"本轮消耗"面板里"思考"那一栏从来不出现,因为每轮回复的思考 token 数在中间层就丢了,客户端拿不到。

已核对的事实(本机实测,2026-11-03)

  • Strata 0.2.10(提交 ffa80d73),自带 harness 包 @deepseek-ai/dsh-llm-pi-ai 版本 0.2.1-alpha.3
  • 打包文件 C:\Users\123\AppData\Local\Programs\Strata\harness\node_modules\@deepseek-ai\dsh-llm-pi-ai\lib\index.js 第 1439–1447 行的 mapUsage() 只复制 inputTokens / outputTokens / totalTokens / cacheReadTokens / cacheWriteTokens,没有 reasoningTokens
  • 上游仓库 master 分支 packages/llm/llm-pi-ai/src/stream.ts(blob sha 17b71581)第 24–32 行同样没有,整个文件 reasoningTokens 出现 0 次 → 单纯升级 harness 版本不会带来这个数
  • 显示端已经准备好了:@deepseek-ai/dsh-client-ui-chat 的 TurnUsagePanel 里写的是 usage.reasoningTokens !== undefined 才渲染那一行(lib/client.js 第 6902–6904 行),dsh-client-ui-trajectory 里也有对应显示位。数字一到,界面就能显示
  • 提供方确实给了数:OpenAI 兼容流式返回的末尾 usage 里带 completion_tokens_details.reasoning_tokens

已有的公开材料:上游讨论 https://github.com/deepseek-ai/deepseek-harness/discussions/11352 (我在 10-28 提的;11-01 有社区用户贴了他 fork 里带测试的补丁,上游仓库关闭了 issue 与 pull request 通道,补丁送不进去)。那条回复里的测试数字属社区自述,未获官方证实。

为什么写在本 issue 下面:两条是同一件事的两端 —— 都卡在"给 AI 的消耗数字对用户不透明"。上下文压缩需要"到自动压缩还剩多少"的预警,思考 token 是"这一轮花了多少"的组成部分;两个数在 Strata 侧的显示位都已存在,缺的都是把数据传上来那一步。

没测的:没有跑真实模型请求验证社区补丁的效果,以上结论来自读代码与版本比对;对上游 master 的核对是 2026-11-03 做的,后续版本若有改动请以最新代码为准。

<!-- gh-comment-id:6602639487 --> @xvcezrqpbxtpzblrt commented on GitHub (Nov 3, 2026): 顺带一个同类的"数字看不见"的问题,供参考 —— 它跟本 issue 不是同一个主题,列在这里只为把两处可见性缺口串起来,方便一次定位。 **现象**:界面"本轮消耗"面板里"思考"那一栏从来不出现,因为每轮回复的思考 token 数在中间层就丢了,客户端拿不到。 **已核对的事实(本机实测,2026-11-03)** - Strata 0.2.10(提交 `ffa80d73`),自带 harness 包 `@deepseek-ai/dsh-llm-pi-ai` 版本 `0.2.1-alpha.3` - 打包文件 `C:\Users\123\AppData\Local\Programs\Strata\harness\node_modules\@deepseek-ai\dsh-llm-pi-ai\lib\index.js` 第 1439–1447 行的 `mapUsage()` 只复制 `inputTokens` / `outputTokens` / `totalTokens` / `cacheReadTokens` / `cacheWriteTokens`,**没有 `reasoningTokens`** - 上游仓库 master 分支 `packages/llm/llm-pi-ai/src/stream.ts`(blob sha `17b71581`)第 24–32 行同样没有,整个文件 `reasoningTokens` 出现 **0 次** → 单纯升级 harness 版本不会带来这个数 - 显示端**已经准备好**了:`@deepseek-ai/dsh-client-ui-chat` 的 TurnUsagePanel 里写的是 `usage.reasoningTokens !== undefined` 才渲染那一行(`lib/client.js` 第 6902–6904 行),`dsh-client-ui-trajectory` 里也有对应显示位。数字一到,界面就能显示 - 提供方确实给了数:OpenAI 兼容流式返回的末尾 usage 里带 `completion_tokens_details.reasoning_tokens` **已有的公开材料**:上游讨论 https://github.com/deepseek-ai/deepseek-harness/discussions/11352 (我在 10-28 提的;11-01 有社区用户贴了他 fork 里带测试的补丁,上游仓库关闭了 issue 与 pull request 通道,补丁送不进去)。那条回复里的测试数字属社区自述,**未获官方证实**。 **为什么写在本 issue 下面**:两条是同一件事的两端 —— 都卡在"给 AI 的消耗数字对用户不透明"。上下文压缩需要"到自动压缩还剩多少"的预警,思考 token 是"这一轮花了多少"的组成部分;两个数在 Strata 侧的显示位都已存在,缺的都是把数据传上来那一步。 **没测的**:没有跑真实模型请求验证社区补丁的效果,以上结论来自读代码与版本比对;对上游 master 的核对是 2026-11-03 做的,后续版本若有改动请以最新代码为准。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2375
No description provided.