# Changelog 本文件记录 dsh-token-rush 的版本变更,格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/), 版本号遵循[语义化版本](https://semver.org/lang/zh-CN/):主版本号对应不兼容的架构变更,次版本号对应向后兼容的功能新增,修订号对应问题修复。 Every release opens with a one-line English summary, then the Chinese detail. ## [1.1.0] - 2026-10-01 修好「金额算不准」与「桌面端余额不可用」,并把中国法定节假日从高峰时段中排除。 Fixes the inaccurate spend estimate and the unusable balance in the desktop shell, and stops billing statutory holidays as peak hours. ### 修复 / Fixed - 消耗金额按官方现价重算:Flash 档缓存未命中 `1.5 → 1.0`、缓存命中 `0.05 → 0.02`、输出 `4.5 → 4.0` 元/百万 tokens(原表把 Flash 档写成了高估 12.5%–150% 的旧价);新增当前正式 id `deepseek-flash`,并支持 `provider/model` 形式的模型 id(`deepseek-v4-pro` 一档原表本就正确)。 Spend now matches the official rates: Flash cache-miss `1.5 → 1.0`, cache-hit `0.05 → 0.02`, output `4.5 → 4.0` CNY/M (the old table over-estimated Flash by 12.5%–150%). Adds the current id `deepseek-flash` and provider-qualified ids. - 桌面端账户余额一行始终显示「余额不可用」:host 侧只读路由的同源校验会拒绝桌面壳(`dsh-app://app`)转发的请求——Electron 的 `forwardWebRequest()` 会剥掉 `Origin`、`Cookie` 与 `Sec-Fetch-Site` 再补上 host 会话 cookie。改为校验请求 Host 是否为本进程自己的 loopback 监听(同时挡住 DNS rebinding),同源网页与桌面壳都能读到余额。 The desktop balance row always read "unavailable": the host-side same-origin guard rejected the desktop shell's forwarded request, because `forwardWebRequest()` strips `Origin`, `Cookie` and `Sec-Fetch-Site` before replaying it against the host. The guard now checks the request authority against this process's own loopback listener (which also blocks DNS rebinding). - 计价模型改用 `modelSelection.lastUsed`(真正跑过请求的模型);切换模型尚未生效时,不再把整段会话按新模型计价。 Pricing follows `modelSelection.lastUsed` (the model that actually served the tokens), instead of billing the whole session with a not-yet-applied selection. - 余额查询失败时显示原因(如「余额 不可用(403)」「余额 未配置 Key」),悬停可见详情,而不是一句笼统的「不可用」。 A failed balance lookup now states its reason (`unavailable (403)`, `no key configured`) with details in the tooltip. ### 新增 / Added - 法定节假日不计高峰:官方高峰时段排除中国法定节假日,内置 2026 年清单(依据国办发明电〔2025〕7 号);新增环境变量 `DSH_HUD_PEAK_HOLIDAYS`(`2027-01-01,2027-02-05..2027-02-11`,`none` 关闭该规则)。 Statutory holidays are never peak: the built-in list covers 2026 (per 国办发明电〔2025〕7 号) and `DSH_HUD_PEAK_HOLIDAYS` overrides it for other years (`none` disables the rule). - 浏览器半区冒烟测试 `dev/client-smoke.mjs`:冻结时钟,覆盖挂载 / 可见性 / 计价 / 版本落差 / 节假日 / 余额文案。 New browser-half smoke suite `dev/client-smoke.mjs` with a frozen clock. ### 变更 / Changed - 高峰判定改为「host 下发配置(时间段 / 时区 / 节假日),浏览器半区按同一规则判定」;单价表以浏览器半区为准,host 表只补充它还不认识的模型。两半区都是 DSH 插件,但只有浏览器半区随 client-hmr 热更新,这样 host 半区较旧时显示的数字也不会失真。 The host now supplies configuration (windows / timezone / holidays) while the browser half computes the verdict and owns the price table; a host half running older bytes can no longer distort the numbers on screen. - README 补充计价口径表、节假日规则、只读路由访问控制与两半区各自的加载时机。 README gains the pricing table, the holiday rule, the route access rule and the reload semantics of each half. ## [1.0.0] - 2026-09-04 首个版本:会话页左上角悬浮窗,实时 token(进 / 出 / 缓存分桶)、按官方单价的消耗估算、账户余额,高峰时段整体变橙红色且可拖动。 First release: the top-left session HUD with live tokens, spend estimate, account balance and the orange-red rush-hour state. [1.1.0]: https://github.com/mikijiyun/dsh-token-rush/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/mikijiyun/dsh-token-rush/releases/tag/v1.0.0