From 47a444f21b8cb210afc6a3b229178bd1b2c0cdfc Mon Sep 17 00:00:00 2001 From: Bosheng0422 Date: Fri, 21 Aug 2026 13:46:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=96=87token=E8=AE=A1=E6=95=B0=E5=A4=B1=E6=95=88=E4=B8=8D?= =?UTF-8?q?=E5=87=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + dashboard/src/pages/Chat/components/ContextWindowRing.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bb9be11..8f729071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### 修复 +- 上下文使用面板的分段图例现在加得起来:分段条早已按 provider 实际输入总量归一化,图例却打印未缩放的原始估算值,两者对不上;图例改用同一缩放系数。 - 技能:修复编辑已导入技能并保存后,技能内其余文件与文件夹(README.md、references/ 等)被整体清除的问题--内容编辑(仅 SKILL.md)现原地覆盖清单文件、保留全部同级文件;携带完整 `files` 载荷的更新仍整目录替换(与覆盖重装语义一致) - Harness usage 事件按稳定调用 ID 去重,避免流重放重复计费;上下文环保留路由模型的真实窗口上限,并将构成拆分明确显示为近似估算。 diff --git a/dashboard/src/pages/Chat/components/ContextWindowRing.tsx b/dashboard/src/pages/Chat/components/ContextWindowRing.tsx index d093e023..d04abcb8 100644 --- a/dashboard/src/pages/Chat/components/ContextWindowRing.tsx +++ b/dashboard/src/pages/Chat/components/ContextWindowRing.tsx @@ -217,6 +217,12 @@ export default function ContextWindowRing({ ] as ContextUsageBreakdown["segments"]) : display.segments; const segmentTotal = segments.reduce((sum, item) => sum + item.tokens, 0); + // Segments are harness-side estimates and run short of the provider's input + // total; the bar already normalizes them onto ``displayUsed``. Scale the + // legend by the same factor so the listed parts sum to the header figure + // instead of silently falling short of it. + const scaleToUsed = (tokens: number) => + segmentTotal > 0 ? Math.round((displayUsed * tokens) / segmentTotal) : tokens; const popoverContent = (
@@ -278,7 +284,7 @@ export default function ContextWindowRing({ {t(`chat.contextWindow.segments.${segment.key}`)} - ~{formatTokenK(segment.tokens)} + ~{formatTokenK(scaleToUsed(segment.tokens))} ))} From c41c5796c431bb51a555b585d582aac02f2cc3a8 Mon Sep 17 00:00:00 2001 From: Bosheng0422 Date: Fri, 21 Aug 2026 14:55:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0harness-memory=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9ec60f94..9b98629b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "argon2-cffi>=23.1", "pyjwt>=2.8", "orcakit-harness-agent[all]>=0.9.20", - "harness-memory>=0.9.6", + "harness-memory>=0.9.7", "harness-gateway>=0.9.3", "cryptography>=41", "scalar-fastapi>=1.0", diff --git a/uv.lock b/uv.lock index 3b6b0807..357101e5 100644 --- a/uv.lock +++ b/uv.lock @@ -2549,7 +2549,7 @@ requires-dist = [ { name = "fastembed", marker = "extra == 'local-embedding'", specifier = ">=0.4" }, { name = "harness-browser", specifier = ">=0.7.5" }, { name = "harness-gateway", specifier = ">=0.9.3" }, - { name = "harness-memory", specifier = ">=0.9.5" }, + { name = "harness-memory", specifier = ">=0.9.7" }, { name = "httpx", marker = "extra == 'dev'", specifier = ">=0.27" }, { name = "huggingface-hub", marker = "extra == 'local-embedding'", specifier = ">=0.20" }, { name = "josepy", specifier = ">=2.2.0" },