# 历史版本变更记录 / Release Notes Archive

本文档归档 `README.md` / `README_en.md` 变更日志表格中超出「最近 10 个版本」范围的更早版本摘要。完整、详细的变更记录请见 [CHANGELOG.md](./CHANGELOG.md)。

This document archives the older release summaries that fall outside the "latest 10 versions" kept in the `README.md` / `README_en.md` changelog tables. For the full, detailed changelog, see [CHANGELOG.md](./CHANGELOG.md).

## 中文

| 版本 | 发布内容 |
| --- | --- |
| **v2.3.2399** | <ul><li>**bypass 模式下 SSE 误标 application/json 兜底修复**: bypass 的 provider 跳过 transformer 链后，SSE body + JSON 头的响应直达 formatResponse 仍会抛 non-JSON；现在 formatResponse 先 peek body 实际内容，SSE 按流式透传，作为该问题的最后一层兜底。</li></ul> |
| **v2.3.2398** | <ul><li>**修复 Codex 中转 SSE 被误标 application/json 时丢失内容**: 补齐 v2.3.2397 漏掉的 `OpenAIResponsesTransformer` 同类问题——上游返回 SSE body 但 Content-Type 标 `application/json` 时不再抛 `non-JSON` 错误，改为 peek body 实际内容后按 SSE 透传。</li></ul> |
| **v2.3.2397** | <ul><li>**修复 SSE 响应被误标 application/json 时丢失内容**: Codex 中转/OpenRouter 错误响应把 SSE body 标成 `application/json` 时，Anthropic transformer 此前按 Content-Type 当非流式 JSON 解析并抛错；现在先 peek body 实际内容，确为 SSE（`event:`/`data:`/`: ` 开头）则走流式转换，仅确为 JSON 才解析，行首匹配不误伤含 `event` 字段的 JSON。</li></ul> |
| **v2.3.2396** | <ul><li>**修复 OpenRouter SSE 被当作 JSON 解析**: 最终响应改为按实际 Content-Type 判断流式/非流式，并为 transformer 的 JSON 解析增加原始响应预览，`stealth/ox-alpha` 等返回 `: OPENROUTER PROCESSING` 时不再只报 `Unexpected token ':'`。</li><li>**修复 OpenCode Go 多轮 thinking 缓存断点**: 历史 assistant `thinking` 现在会回放为 `reasoning_content` + signature，避免缓存只能命中到首个 thinking turn 前（常见约 64k）及 `reasoning_content must be passed back` 400；直连 181k 请求验证上游可命中 99.88%。</li><li>**自定义 transformer 参数可直接编辑**: 参数行新增编辑按钮，以 key/value 回填输入框；嵌套 JSON/布尔/数字可修改后按同名 key 覆盖，无需删除重输。</li></ul> |
| **v2.3.2395** | <ul><li>**UI 转换器参数支持嵌套 JSON/布尔/数字**: 参数值此前一律按字符串保存，`customparams` 的 deep merge 无法应用字符串参数，结构化参数（如强制 reasoning 端点的 `{"enabled":true,"effort":"max"}`）在 UI 里配了也无效；现在按类型解析（畸形 JSON 保留原文），参数回显不再显示 `[object Object]`。</li></ul> |
| **v2.3.2394** | <ul><li>**严格项目路由不再因熔断目标返回 503**: 项目目标仅因 health fail-pool 不可用且无备用模型时，CCR 跳过健康检查继续请求项目配置的同一模型，让客户端收到真实上游结果；供应商/模型缺失、禁用、格式或额度错误仍拒绝，不逃逸项目边界。</li><li>**修复非流式 TTFT 与 token 速率统计**: 非流式响应不再把总耗时冒充 TTFT（显示 `-`），速率改为输出 token ÷ 总耗时，并阻止假 TTFT 污染平均值。</li></ul> |
| **v2.3.2393** | <ul><li>**项目接管按项目 Router 封顶上下文窗口**: 项目级接管此前只按全局 Router/ContextWindow 写 auto-compact 窗口，全局开 `[1m]` 而项目未启用扩展上下文时项目仍带 >200k 窗口，超 200k 后无可用模型；现在项目默认 family 或顶层 `enableExtendedContext` 未启用时窗口封顶 `min(ContextWindow, 200000)` 并清除陈旧 `[1m]` alias，保存项目 Router 与全局配置后都会刷新自定义 Router 项目的接管。用户手写窗口与 state 审计行为不变。</li><li>**opencode go 缓存命中从 0% 恢复**: zen 上游的提示词缓存以显式 `cache_control` 为前提（实测带标记第 2 次起 ≈98% 命中），transformer 此前把标记全部剥除导致永不缓存；现在保留标记，并在 `cached_tokens` 缺失时兜底映射 DeepSeek 风格 `prompt_cache_hit_tokens`。</li></ul> |
| **v2.3.2392** | <ul><li>**用量按日统计按本地时区分组**: `byDay` 此前取 UTC 日期，本地 0:00–8:00 的请求（UTC 仍是昨天）被归到前一天——表现为「过了零点后昨天的消耗还在涨、今天的偏少」；改用 `date(timestamp,'localtime')` 按进程时区分组，历史记录无需迁移即自动重新归类。</li></ul> |
| **v2.3.239** | <ul><li>**供应商慢网探测与黄色 ⚠️ 告警**: 后台对每个供应商的 `/models` 可达性探测现在记录延迟，超过 `PROBE_SLOW_THRESHOLD_MS`（默认 3000ms）在 provider 卡片显示黄色 ⚠️；`GET /api/providers/health` 追加 `probes`，手动探测返回 latency/status/isSlow。慢但成功不开熔断，仅作 UI 提示。</li><li>**用量汇总改 SQL 聚合，UI 不再随机卡顿**: `/api/providers/quota`、`/api/usage` 的 summary 此前 `SELECT *` 全量物化 + JS 聚合阻塞 event loop，是 health/quota 随机卡顿的共享根因；改为 SQL `COUNT/SUM/AVG/GROUP BY`，语义不变。</li><li>**UI 刷新循环重做，杜绝请求重叠**: Providers health/quota 改 60s 自调度 single-flight；Usage 改 30s 串行队列（上一个未返回下一个顺延）；`/api/clients` 仅 mount 刷新（操作后复用响应、不再 visibility 补拉）；页面隐藏时暂停。</li><li>**Image 路由根因修复**: image agent 此前在路由前改写 `req.body.model`，导致用量记录丢失客户端真实模型（如 ccr-opus）并绕过 family image 路由；现按客户端原始模型识别 family 路由图片。同时修复 `promoteToolResultImages` 把所有数组型 tool_result 内容替换为占位符、丢失文本/结构化内容的问题。</li><li>**移除已弃用的 Codex 多账号管理**: 删除账号列表、切换、后台自动维护及对应 API/CLI/UI；Codex 仍作为普通 provider/client 完整支持（检测、`/v1/responses`、transformer、takeover、用量归属），历史账号文件与 `~/.codex/auth.json` 保持不动。</li><li>**路由优先级：模型族优先于 explicit `provider,model`**: 开启 family routing 时请求先走模型族映射，命中即用；family 未命中才解析客户端显式指定，最后落默认路由。</li></ul> |
| **v2.3.238** | <ul><li>**更新成功后服务自动重启**: 修复 `performUpdate` 跑完 `npm install -g` 只返回“请手动重启”、从不真正重启的问题；现在成功后复用 `/api/restart` 的自重启模式自动重启服务，前端轮询 `checkForUpdates` 返回 `hasUpdate:false` 后自动刷新页面加载新前端。</li><li>**更新请求并发锁**: 新增模块级 `updateInProgress` 守卫，刷新页面丢失 UI 状态后再次点击“立即更新”不会再触发第二次 `npm install -g`。</li><li>**超时文案补全包名**: `app.update_timeout` 改为“手动执行 `npm install -g @wengine-ai/claude-code-router-next@latest`”，照抄即可成功。</li></ul> |
| **v2.3.237** | <ul><li>**更新操作显示进度并限制等待时间**: 点击“立即更新”后禁用弹窗按钮并显示“更新中…”状态，避免重复安装；前端请求与后端 `npm install -g` 均设置 5 分钟超时，后端输出缓冲提高到 4 MB，超时会显示可读错误而非永久挂起。</li><li>**精简 Claude 项目指引**: 删除可由 manifests、CLI help 和仓库结构直接推导的常驻说明，保留非显然的安全、发布与架构约束，减少每次会话的固定上下文开销。</li></ul> |
| **v2.3.236** | <ul><li>**阿里云 Token Plan 用量查询（5h/7d 额度）**: 为 `*.maas.aliyuncs.com` 网关新增专用 `AliyunTokenPlanQuotaAdapter`，走 Token Plan 专用 BroadScope 用量接口并把 `per5HourPercentage`/`per1WeekPercentage` 映射为 5h/7d 百分比展示。</li><li>**`quota_sec_token` 配置项与官方网关 + legacy 回退**: provider 可选 `quota_sec_token` 与 UI 密码输入；配置后走官方 `bailian-cs.console.aliyun.com` 网关（对齐真实控制台请求，`_v=undefined`、动态 trace、不含 spm），失败安全降级到 `cs-data` cookie-only 端点。</li><li>**pi 扩展上下文触发统一为绝对阈值**: 移除 pi 的 `extendedContextRatio`，统一走 family → Router → 200000 的绝对阈值链。</li><li>**测试 HOME 隔离真正到达 vitest worker**: 修复 core/shared 测试套件此前落在真实 `~/.claude-code-router` 的隔离失效问题。</li></ul> |
| **v2.3.235** | <ul><li>**修复 npm 全局安装静默失败**: 此前 `@wengine-ai/llms` 发布包把运行时 shared 依赖保留为 pnpm 的 `workspace:*` 协议，npm 在解析依赖树阶段无法识别并 exit 1。发布流程现在先发布同版本 `@wengine-ai/claude-code-router-shared`，再把 core 中所有 `workspace:` 范围转换为真实 npm version range 后发布，最后发布 CLI；shared/core/CLI 三个发布 manifest 都新增 `workspace:` 拦截校验，防止再次发布 npm 无法安装的包。</li></ul> |
| **v2.3.234** | <ul><li>**修复全局 ContextWindow 变更不传递到已接管项目（auto-compact 窗口冻结）**: 项目在 v2.3.22 之前被接管、或经历 disable→enable 循环导致 `ccr-state.json` 缺失时，`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 会停留在旧值（如 200000）；旧守门把该旧值误判为用户手写值并永久保留，之后任何全局 `ContextWindow` 变更都不再生效，UI 重开关 takeover 也无效。现在 state 缺失时重新视为 CCR-managed，写入当前全局值并重建 state，被覆盖旧值记入 `previousAutoCompactWindow` 留痕；state 存在时仍保留用户手写值不被覆盖的原保证。</li></ul> |
| **v2.3.233** | <ul><li>**修复「立即更新」点击失败（404）**: UI `ApiClient` 的 `baseUrl` 已是 `/api`，但 `performUpdate()` 又传入 `/api/update/perform` 导致实际请求变成 `/api/api/update/perform`；现改为 `/update/perform`，更新请求重新落到服务端 `/api/update/perform`。</li><li>**修复更新弹窗永远显示「暂无更新日志」**: `checkForUpdates` 此前 `changelog` 恒为空字符串。现在检测到新版本时，优先从已发布 npm 包对应版本 README 的 changelog 表提取摘要，取不到再 fallback 到 GitHub `CHANGELOG.md` 对应版本段，两级都失败才回退兜底文案，网络错误不影响版本检查。</li></ul> |
| **v2.3.232** | <ul><li>**严格项目级路由成为权威边界**: 项目配置非空 `Router` 后，目标缺失、格式错误、被禁用、不健康或额度耗尽不再静默回落到全局，而是返回稳定错误码；项目内显式 fallback 仍可用，同时关闭全局 Router/custom router、全局 fallback、客户端与 subagent model override 等项目外逃逸路径。</li><li>**Provider 级代理策略**: 新增顶层 `PROXY_GLOBAL_ENABLED` 与 provider 级 `proxy_enabled`；全局关闭时仅显式标记的 provider 使用共享 `PROXY_URL`，其余直连，未配置或开启时保持全部走代理的旧行为。推理、fallback、健康探测、额度查询、wakeup、provider API tokenizer 等出站请求统一遵循该策略。</li><li>**代理安全校验与 UI 控制**: 保存配置前仅允许 `http://`、`https://`、空值或环境变量占位符，非法协议/畸形 URL 逐项报错且不覆盖原配置；设置页新增「全局生效」开关、provider 卡片新增独立代理开关，并提示仅使用可信代理。ProxyAgent 改为按 URL 缓存复用，关闭时释放，日志自动脱敏代理凭据。</li><li>**per-client adapters 与 pi 上下文路由**: runtime 下沉到 core 并用 adapter 统一 Claude Code、Codex、pi、qwen-code、opencode 的差异；pi 新增 `extendedContextRatio`（默认 80%），不再生成/消费 `[1m]` 后缀，longContext 改用绝对阈值链。</li><li>**修复严格路由、客户端识别与用量回归**: 畸形项目 target 不再逃逸全局；Codex Responses 请求不再被误判为 Claude Code；修复非流式 `upstreamModel` 丢失、失败请求串用上一请求 tokens、`response.completed` 将 usage merge base 归零、项目路由失败清除会话用量基线等问题。</li><li>**修复 runtime 生命周期与错误处理**: `createCcrServer({ port })` 正确采用传入端口，401/403 认证不再挂起，provider/transformer/tokenizer 初始化完成后才监听，preset 注册失败不再静默吞掉。</li></ul> |
| **v2.3.231** | <ul><li>**项目级接管默认仅接管 Claude Code**: 此前打开项目「CCR 接管」默认接管全部客户端（Claude Code、pi、qwen-code、opencode），会把 `.pi/settings.json`、`.qwen/settings.json`、`opencode.json` 等配置写进项目目录（opencode 首次运行还会自行生成 `AGENTS.md`），污染项目根目录；现在所有默认路径（主开关、多选清空、legacy `enabled: true`）都只接管 Claude Code，其余客户端在多选中显式勾选才接管。</li><li>**修复「检查更新」永远提示已是最新（双重 bug）**: 后端 `checkForUpdates`/`performUpdate` 硬编码了已从 npm unpublish 的旧包名 `claude-code-router-next`，`npm view` 404 被 catch 静默吞掉、恒返回「无更新」，「立即更新」也因同样的错包名安装失败，现改为从 `package.json` 动态读取包名（`@wengine-ai/claude-code-router-next`），今后改包名不会再失效；另外前端更新弹窗条件要求 `changelog` 非空而后端该字段恒为空串，即使有新版本也不弹窗，现去掉该强制判断（弹窗内已有「暂无更新日志」兜底文案）。</li><li>**发布确认点闸门（release gate）**: `scripts/release.sh` 新增 `validate_release_docs`，发布前（含 dry-run）强制校验：6 个 `package.json` 版本一致、`CHANGELOG.md` 有该版本的非空段落、两份 README 表格有该版本行、版本号严格大于 npm 已发布 latest（逐段数字比较，registry 不可达时警告跳过）；任一不满足即中止发布。</li><li>**版本号策略：多位 patch 日常小迭代**: 自本版本起日常小迭代在 patch 段追加一位数字（`2.3.23` → `2.3.231` → `2.3.232`），避免每日发布推高主版本数字；patch 按数字比较，用过 `2.3.23x` 后下一个功能版本是 `2.3.240`（`2.3.24` 会被闸门当降级拦截）或直接升 `2.4.0`。</li></ul> |
| **v2.3.23** | <ul><li>**修复状态栏 token 速率虚高（撞到 999 上限）**: `ccr statusline` 的 token 速率常显示几百、极端撞到 999 上限，与「用量统计」的几十 t/s 对不上。根因是 token-speed 插件流式过程中每秒上报的是「最近 1 秒到达的 token 数」滑动窗口值，而 SSE delta 常成批到达（同一时间戳）使瞬时计数虚高；现改为与用量统计同一套解码平均公式（`输出 token ÷ (总耗时 − TTFT)`）上报，速率随流式收敛到最终值、与用量统计一致，并移除失效的滑动窗口记账。</li><li>**状态栏默认改为无图标表格风格**: 默认主题不再带装饰图标，模块之间改用细竖线 `│` 分隔，呈简洁表格样式，默认模块顺序为「模型 │ 工作目录 │ git 分支 │ 上下文进度条 │ token 速率 │ 会话总 token」。动机是歧义宽度的 emoji 图标（如闪电 `⚡` U+26A1）会让 Claude Code 误算状态栏显示宽度、在双击等重绘时产生数字重影/位移；改用定宽字符或不带图标可避免。图标仍支持在 UI 中自定义。</li><li>**修复 UI 状态栏图标无法删除 + 旧圆圈模块迁移**: 切换所选模块时图标搜索框（`IconSearchInput`）不随 `value` 同步、与模块真实图标脱节导致看似删不掉，现已在 `value` 变化时同步；同时加载配置时把旧 `contextCircle` 模块迁移为 `contextBar`，配置弹窗显示长条进度条而非旧圆圈图标。</li><li>**`build:ui` 构建后同步产物到 CLI/根 dist**: `pnpm build:ui` 现会把 `index.html` 同步到 `packages/cli/dist` 与根 `dist`，使单独运行 `build:ui` 也能更新本地运行中的 ccr 实际读取的包。</li></ul> |
| **v2.3.22** | <ul><li>**状态栏按用户配置的压缩阈值显示上下文上限**: `ccr statusline` 优先用 `CLAUDE_CODE_AUTO_COMPACT_WINDOW`（CCR 从顶层 `ContextWindow` 写入）作为上下文上限与百分比分母，未设才回退到 Claude Code 的窗口值，使状态栏与实际 auto-compact 触发点对齐，不再固定显示 1M/200k。</li><li>**接管保留用户手写的 auto-compact 自定义值**: CCR 接管 Claude Code 时不再无条件用 `ContextWindow` 覆盖 `CLAUDE_CODE_AUTO_COMPACT_WINDOW`，改用状态文件（`~/.claude-code-router/client-state.json` 全局、`<project-id>/ccr-state.json` 项目级）区分 CCR 写入值（可随 `ContextWindow` 更新）与用户手写值（保留）；卸载只清自己写的、保留用户的；状态缺失时保守保留，绝不误覆盖。</li><li>**UI 上下文窗口与扩展上下文配合提示**: 顶层 `ContextWindow` > 200000 但未启用对应模型家族「扩展上下文 (1M)」（模型名带 `[1m]`）时显示红色警告，并在两处配置补充配合说明——否则 Claude Code 会将其封顶至 200000。</li><li>**修复状态栏百分比按 1M 计算与偶发闪 0%**: statusline 子进程不一定继承项目级 settings 的环境变量，导致项目里设的 `CLAUDE_CODE_AUTO_COMPACT_WINDOW` 被漏读而按 1M 计算，现在依次从 `process.env`→项目 `settings.local.json`→全局 `settings.json` 读取；另 `current_usage` 在请求进行中/刚 auto-compact 后会暂态为空使百分比偶发闪 0%，现回退到 transcript 最近一条 assistant 消息的上下文用量保持稳定。</li><li>**修复项目接管 disable→enable 循环冻结窗口与 disable 残留**: 项目级 `ccr-state.json` 在 disable 后丢失、再 enable 时不重建，导致 CCR 无法识别自己写入的窗口——既会让 `ContextWindow` 变更无法刷新生效，也会在关闭接管时把 `CLAUDE_CODE_AUTO_COMPACT_WINDOW` 当用户值残留。现在状态缺失时按「值等于当前 `ContextWindow`」兜底识别 CCR-managed，enable 重建状态、disable 清残留，真正的用户手写值仍保留。</li></ul> |
| **v2.3.22** | <ul><li>**Status Line Shows the User-Configured Compact Threshold as the Context Limit**: `ccr statusline` now uses `CLAUDE_CODE_AUTO_COMPACT_WINDOW` (the value CCR writes from the top-level `ContextWindow`) as the context limit and percentage denominator, falling back to Claude Code's window value only when unset — so the status line aligns with the actual auto-compact trigger point instead of always showing 1M/200k.</li><li>**Takeover Preserves User-Hand-Written auto-compact Values**: When taking over Claude Code, CCR no longer unconditionally overwrites `CLAUDE_CODE_AUTO_COMPACT_WINDOW` with `ContextWindow`. A state file (`~/.claude-code-router/client-state.json` global, `<project-id>/ccr-state.json` per-project) distinguishes CCR-written values (updated with `ContextWindow`) from user-hand-written values (preserved); teardown removes only CCR-written values and keeps user ones; with no state on disk it conservatively preserves any existing value and never mis-overwrites.</li><li>**UI Context-Window ↔ Extended-Context Coupling Hint**: When the top-level `ContextWindow` exceeds 200000 but the model family's "Extended Context (1M)" (which appends `[1m]` to the model name) is not enabled, a red warning is shown, and both config items now document the coupling — otherwise Claude Code caps the value at 200000.</li><li>**Fixed Status Line Percent Computed at 1M and Flashing 0%**: The statusline child process does not always inherit project-level settings env, so a `CLAUDE_CODE_AUTO_COMPACT_WINDOW` set in a project's `settings.local.json` could be missed and the percent fell back to the model's full window (e.g. 1M); it is now resolved from `process.env` → project `settings.local.json` → global `settings.json`. Separately, `current_usage` is a per-turn snapshot that is transiently empty (request in flight, right after auto-compact), which made the percent flash 0%; it now falls back to the last assistant message's context usage from the transcript to stay stable.</li><li>**Fixed Frozen Window After Takeover disable→enable and Residual on Disable**: A project's `ccr-state.json` could be lost after a disable→enable cycle, so CCR could no longer recognize its own window — neither refreshing `ContextWindow` took effect nor did disabling remove the `CLAUDE_CODE_AUTO_COMPACT_WINDOW` (it leaked as a residual). When state is missing, CCR now treats a value matching the current `ContextWindow` as CCR-managed: enable rebuilds the state, disable removes the field, while a genuinely user-hand-written value is still preserved.</li></ul> |
| **v2.3.21** | <ul><li>**新增 pi (earendil-works) 客户端接管**: 新增 pi 作为第三个接管目标（与 Claude Code、Codex 并列），pi 使用 Anthropic `/v1/messages` 协议直连无需 transformer；接管会在 `~/.pi/agent` 写入 `models.json` 与 `settings.json`，备份原文件，仅做配置注入不含账号管理；用量统计靠 pi system prompt 特征 + Anthropic SDK 请求头区分 pi 与 Claude Code。</li><li>**项目级接管支持多客户端多选**: 「CCR 接管」从只接管 Claude Code 改为客户端多选下拉（Claude Code + pi + qwen-code + opencode），不选默认接管全部；pi 项目级接管在项目目录写 `.pi/settings.json` 并在 `trust.json` 信任该目录。</li><li>**新增 qwen-code (Alibaba) 客户端接管**: 新增 qwen-code 作为第四个接管目标，走 Anthropic `/v1/messages` 直连；接管写入 `~/.qwen/settings.json`（用户级）/ `<项目>/.qwen/settings.json`（项目级）与 `trustedFolders.json`，备份原文件。用量统计靠 qwen system prompt 特征正向识别（qwen 经代理会伪装 Claude Code UA）。</li><li>**新增 opencode (opencode.ai) 客户端接管**: 新增 opencode 作为第五个接管目标，走 Anthropic `/v1/messages` 直连；接管在 `~/.config/opencode/opencode.json` / `<项目>/opencode.json` 注入 `@ai-sdk/anthropic` 的 `provider.ccr`，备份原文件，无需 trust。用量统计按非伪装的 `opencode/…` UA 识别。</li></ul> |
| **v2.3.20** | <ul><li>**清理改名/删除模型后残留的僵尸熔断记录**: 从 provider 的 `models` 重命名/删除模型后，旧名字在 `provider-health.json` 中的熔断记录会成为僵尸，UI 一直显示 `Failed`，重启与刷新也无法清除。新增 `health-reconcile`，在服务启动、保存配置和 probe 成功时按当前 provider 模型与 Router/fallback 引用清理残留记录，并保留仅由路由引用的有效模型健康状态。</li></ul> |
| **v2.3.19** | <ul><li>**新增 OpenCode (opencode.ai) Transformer**: 为暴露 OpenAI 兼容 `/v1/chat/completions`、底层由 GLM/智谱驱动的 OpenCode 类 provider 新增专用 transformer，显式声明 `endPoint` 避免误触 bypass 把 Anthropic 格式工具发给 OpenAI 兼容接口；同时清理 GLM 不识别的 `cache_control`/`image_url`/`media_type`，转换 `reasoning_content` 为 thinking 格式，并把纯数字 `tool_call` ID 替换为 UUID。在 provider `transformer` 中配置 `"opencode"` 启用。</li><li>**设置页代理地址与 API 密钥输入框禁用浏览器自动填充**: 弹窗版与整页版设置的「代理地址」「API 密钥」此前会被 Chrome 用已保存表单数据/密码自动填充覆盖真实值；现在通过 `Input` 的 `disableAutofill` 提供随机 `name`、初始 `readOnly` 至首次聚焦解除、`autoComplete="off"` 及密码管理器忽略标记三重防护，并配合隐藏 honeypot 字段。</li></ul> |
| **v2.3.18** | <ul><li>**模型族长上下文阈值继承主路由配置**: `ccr-opus`/`ccr-sonnet`/`ccr-haiku` 的 family routing 未配置族级阈值时会继承 `Router.longContextThreshold`，避免主路由设为 100k 时约 70k token 请求仍误进 `<family>/longContext`。</li><li>**fallback 候选模型也执行 Double-Check 重试**: 每个 fallback 候选第一次 `fetch failed`/空 SSE/隐藏错误后会先对同一候选重试一次，第二次仍失败才切到下一个，降低智谱等接口短暂不稳定导致的过早切换；同时修正失败记录的 `originalModel` 显示。</li><li>**全局配置保存后同步项目级 CCR 接管字段**: 跟随全局 Router 且已开启 CCR Takeover 的项目，在保存全局配置或切回使用全局配置时自动刷新 `.claude/settings.local.json` 中的模型族别名、auto-compact、状态栏与代理字段。</li><li>**默认降低日志量并保留最近 7 天**: 服务器日志默认级别从 `debug` 调整为 `error`，只在显式配置 `LOG_LEVEL=info/debug/trace` 时输出详细日志，并自动清理超过 7 天的 `ccr-*.log`。</li></ul> |
| **v2.3.17** | <ul><li>**修复 fallback 触发时所有备用模型报 Invalid URL**: 主模型限流（如智谱套餐）触发 fallback 后，此前所有备用模型都报 `Invalid URL`；根因是 fallback 用了原始 `ConfigProvider[]`（无 `baseUrl`）而非已注册的 `LLMProvider[]`，改为 `providerService.getProviders()`。</li><li>**修复 fireworks 托管上游用量统计全 0**: fireworks 流式把真实 usage 放在 `finish_reason` 之后的 `choices:[]` 空 chunk 里，此前 `finish_reason` 块用 null usage 覆盖了已 merge 的真实值、且 `break` 丢弃了后续 usage chunk，导致 `input` 有值但 `output`/缓存命中为 0；现改为 finish 后继续读取、只设 stop_reason 不碰 usage、`break` 改 `hasFinished=true`，并修复下游三层用量捕获与 `??` 对 0 不 fallback 的问题。</li><li>**忽略已删除模型的残留路由，防止健康池污染**: 从 provider 配置删除模型后，路由与 fallback 中残留的 `provider,model` 仍被当作有效候选反复失败污染健康池；现在对无法匹配的候选直接返回 `null` 并在请求前校验，`ProviderHealthStore` 统一拦截空 provider/model 防畸形 key 污染，同时抽取 `findProviderModel` 共用函数。</li></ul> |
| **v2.3.16** | <ul><li>**修复 system 消息顺序兼容 DeepSeek/vLLM**: OpenAI 兼容提供商（DeepSeek V4、GLM、vLLM）要求 `[system, user, assistant]` 顺序，此前 system 排在 user/assistant 之后会导致输出乱码；现在将 system 消息前置并去重。</li><li>**接管时去除 Attribution 动态头以提升缓存命中**: CCR 接管 Claude Code 时默认写入 `CLAUDE_CODE_ATTRIBUTION_HEADER=0`，去掉系统提示词开头随请求变化的 attribution 头（客户端版本 + prompt fingerprint），稳定上游 prompt 缓存前缀；可在设置页或 `disableAttributionHeader: false` 关闭。</li><li>**设置页布局紧凑化**: 「日志级别」下拉从独占整行移入两列网格，与「API 密钥」并排显示，减少纵向留白。</li></ul> |
| **v2.3.15** | <ul><li>**Fallback 前同模型重试一次**: 模型调用出现一次异常不再立即切换到备用模型，而是先对同一模型自动重试一次（Double-Check），避免因瞬时错误（网络抖动、偶发限流、空 SSE 响应等）导致不必要的模型切换；重试仍失败才走原有 fallback 流程。</li><li>**用量统计显示上游真实模型**: 部分上游网关会偷偷将请求路由/降级到另一个后端模型（如请求 glm-5 实际返回 MiniMax-M2.5）。用量统计的模型映射现在追加上游返回的真实模型，格式为 `originalModel → routedModel → upstreamModel`（如 `ccr-opus → glm-5 → minimax-m2.5`），上游未偷换时自动省略。</li></ul> |
| **v2.3.14** | <ul><li>**修复状态栏显示 `<synthetic>` 模型名**：Claude Code 在 auto-compact 自动压缩、中断恢复时写入的 `<synthetic>` 合成消息（非真实 LLM 响应）此前被状态栏当作模型名显示（从 Claude 账号会话切换到 ccr 接管、或发生自动压缩后尤其常见）；现在过滤该合成标识，正确显示实际路由模型，同时不再把合成消息的 usage 计入 token 统计。</li></ul> |
| **v2.3.13** | <ul><li>**修复删除项目配置未清理项目 `settings.local.json`**：添加项目时自动写入的 ccr 托管字段（代理地址、模型族路由环境变量、auto-compact、statusline 等）此前在删除项目时未被清理；现在删除前会先关闭 takeover，移除这些字段。</li></ul> |
| **v2.3.12** | <ul><li>**修复定时唤醒未真正触发计费周期**：唤醒请求由 `max_tokens: 1` 的 dummy ping 改为真实推理 prompt 与 `max_tokens: 10`，确保 Coding Plan 类提供商产生实际 token 消耗并激活日额度周期。</li><li>**修复 Codex 等 `/messages` 端点唤醒 404**：以 `baseUrl` 是否包含 `/messages` 判断 Anthropic 协议，且 `baseUrl` 作为完整路径直接使用，不再拼接后缀。</li><li>**唤醒/探测请求增加来源头**：新增 `x-claude-code-router-source` 与 `x-claude-code-router-version` 请求头，便于上游识别 CCR 内部探测/唤醒流量。</li></ul> |
| **v2.3.11** | <ul><li>**修复新会话首个请求绕过项目级路由（会话检测竞态）**：新会话的第一个请求（如标题生成元请求，比主请求早到约十几毫秒）到达时 session 转写文件可能尚未落盘，导致项目匹配失败、回退全局 `Router`，使该请求绕过项目级路由（如项目已关 `enableFamilyRouting` 仍走全局模型族路由）。现在缓存未命中时短延迟重试（最多 3×50ms）给文件落盘留时间，并保证每个 session 仅重试一次，避免非托管会话每请求都被加延迟。</li></ul> |
| **v2.3.10** | <ul><li>**修复标题生成等元请求误触发 `think` 场景路由**：`thinking: {type: "disabled"}` 是真值对象，此前会被误判为"已开启思考"并路由到 `think` 模型；现在仅当 `thinking.type === "enabled"` 时才进入 `think` 场景，避免关闭模型族路由的项目仍被路由到全局 think 模型。</li><li>**修复主模型熔断且无 fallback 时返回空模型**：`Router.default` 因健康检查熔断且无可用 fallback 时，此前直接返回空模型导致合成 "provider not found" 错误；现在会跳过健康检查兜底重试主模型，让 Claude Code 收到真实上游响应并自行重试。</li></ul> |
| **v2.3.9** | <ul><li>**Codex 代管理账号令牌自动刷新**：新增后台调度器（启动 60 秒后首次执行，之后每 30 分钟一次），自动检查所有 Codex 代管理账号——无论是否为当前激活账号——当 `access_token` 距过期不足 24 小时，或自上次刷新已超过 7 天时，自动用 `refresh_token` 换取新 token 并写回账号存储；若为当前激活账号，同时同步覆盖 `~/.codex/auth.json`。可通过 `Clients.codex.autoRefreshTokens` 关闭（默认开启）。</li><li>**运行时 fallback 重试未遵循项目级 `enableFallback` 修复**：请求实际发出后失败（如限流）触发的重试 fallback 此前直接读取全局 `Router.enableFallback` 与全局顶层 `fallback` 配置，忽略项目级 `enableFallback: false` 与项目自定义 `Router.fallback`；现在运行时重试与路由阶段使用同一份项目级 fallback 配置。</li></ul> |
| **v2.3.8** | <ul><li>**可配置上下文窗口**：设置页新增 `ContextWindow`，接管 Claude Code / Codex 时用于设置 auto-compact 窗口，默认 200000 tokens。</li><li>**Codex 自动压缩窗口同步**：CCR 接管 Codex 时写入 `model_context_window` 与 `model_auto_compact_token_limit`（约 90%），确保模型别名也能按真实上下文窗口触发自动压缩。</li><li>**项目路由会话识别修复**：兼容 Claude Code `metadata.user_id` 的 JSON/object/legacy session 格式，并只缓存成功匹配，避免首个请求 session 文件尚未生成时项目级路由被长期判定为未命中。</li><li>**关闭模型族路由后别名映射旁路修复**：`enableFamilyRouting` 关闭时，`ccr-opus`/`ccr-sonnet`/`ccr-haiku` 不再被 `Router.models` 中遗留的别名映射拦截，正确回退到项目自定义的 scenario 路由。</li></ul> |
| **v2.3.7** | <ul><li>**新增项目默认接管并跟随全局**：在「项目配置」页添加项目时，默认开启「CCR 接管」与「使用全局配置」，自动写入 ccr 代理配置并保持项目路由实时跟随全局，新项目开箱即用。</li><li>**项目级 fallback 复制修复**：自定义项目路由时正确复制全局顶层 `fallback`，避免备用模型链丢失。</li><li>**接管模型配置同步修复**：切换接管开关时按当前全局配置重新生成托管字段，确保全局变更后重新接管能同步最新模型路由，同时保留 `permissions`/`hooks` 等非托管配置。</li></ul> |
| **v2.3.6** | <ul><li>**项目级 CCR 接管**：Web UI 项目配置页新增「CCR 接管」开关，开启后会将 `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN`、模型族路由环境变量、auto-compact 设置及状态栏命令同步写入该项目的 `.claude/settings.local.json`，使该项目的 Claude Code CLI 无需 `ccr code` 即可直接通过 CCR 路由；关闭接管时会备份当前配置，下次重新接管自动还原，避免个性化配置丢失。</li><li>**项目配置页折叠与同步修复**：项目卡片支持折叠/展开；关闭「使用全局配置」后正确同步全局路由的 fallback 与模型族配置。</li></ul> |
| **v2.1.36** | <ul><li>**Codex 最新 RT 导出**：Codex 账号管理支持导出当前或指定托管账号的最新 refresh token，CLI 新增 `ccr clients codex export-rt [account-id]`，Web UI 新增复制最新 RT 按钮，并会在当前 auth 文件更新时同步托管快照。</li></ul> |
| **v2.1.35** | <ul><li>**定时唤醒稳定性修复**：提供商定时唤醒在 macOS 睡眠/唤醒或系统时间跳变后会重新计算下一次触发时间，避免错过或重复执行唤醒任务。</li></ul> |
| **v2.1.34** | <ul><li>**本地客户端配置接管**：新增 Client Configuration 管理能力，可通过 UI/API/CLI 启用、禁用或恢复本地 Claude Code、Codex 等客户端配置，并自动写入 CCR 代理地址与模型别名。</li><li>**Codex 本地账号代管理**：新增 Codex 账号管理页与 `ccr clients codex` 命令，支持导入当前登录账号、通过 refresh token 导入、切换激活账号、删除托管账号，并对官方 auth 文件做备份与替换。</li><li>**Codex 账号列表缓存优化**：Codex 账号页优先读取本地固化账号与限额缓存，页面刷新无需等待官方 usage 接口；当前账号后台 1 分钟刷新一次，非当前账号 30 分钟刷新一次。</li><li>**Codex / OpenAI Responses API 兼容**：新增 `openai-responses` Transformer，支持 Codex 使用 Responses API wire format 接入 CCR，并完成 Chat/Anthropic 与 Responses 的流式、非流式转换。</li><li>**状态栏视觉升级**：状态栏新增彩色渐变 Context 上下文占用进度条，提升长上下文使用情况的可读性。</li></ul> |
| **v2.1.32** | <ul><li>**供应商刷新按钮位置优化**：单个供应商刷新按钮移动到卡片顶部状态行，位于启用开关左侧；hover 操作区仅保留编辑和删除。</li></ul> |
| **v2.1.31** | <ul><li>**供应商操作区优化**：供应商卡片右侧刷新、编辑、删除按钮改为紧凑横向排列，避免纵向拉伸导致卡片视觉松散。</li></ul> |
| **v2.1.30** | <ul><li>**Codex 多账号限额展示**：Codex 账号管理页新增官方限额信息展示，通过 `chatgpt.com/backend-api/wham/usage` 获取 5 小时速率限制与 7 天周限制的使用百分比和重置时间。</li><li>**Codex 账号自动切换**：Codex 请求前会检查当前账号官方限额，默认任一窗口达到 95% 自动切换到下一个可用账号；仍保留 429/限流错误后的自动切换兜底。</li></ul> |
| **v2.1.27** | <ul><li>**DeepSeek / GLM 工具调用兼容修复**：修复部分 DeepSeek 与 GLM 兼容接口因 `tool_choice` 参数格式不一致导致的请求失败问题。</li></ul> |
| **v2.1.26** | <ul><li>**修复 Anthropic Transformer URI 覆盖问题**：当 `Anthropic` 与 DeepSeek/OpenAI 兼容提供商组合使用时，不再把 `chat/completions` 端点错误改写为 `/v1/messages`，避免 DeepSeek 返回 404。</li><li>**协议转换边界收紧**：仅当 provider 的 `api_base_url` 明确指向 `/messages` 端点时，才将请求体转换为 Anthropic messages 结构。</li></ul> |
| **v2.1.25** | <ul><li>**修复新版 Claude Code (v2.1.154+) 422 报错**：完美解决请求 `/v1/messages` 兼容提供商时因 messages 数组中包含 `role: "system"` 造成的 400/422 报错。</li><li>**动态 Passthrough 绕过自愈**：强制拦截带有 system 消息的 Anthropic 兼容提供商透传，自动进行双向协议规范化与 system 字段合并。</li><li>**响应无损透传修复**：支持目标为 Anthropic 协议响应的原样直出，解决了第三方接口转发时“请求成功但无数据返回”的重大漏洞。</li></ul> |
| **v2.1.22** | <ul><li>**提供商定时唤醒功能 (定时唤醒)**：新增通用及提供商级别的清晨定时自动重置/唤醒机制，通过发送 dummy 消息提前激活额度。</li><li>**对称用量展示面板**：将 Web 控制台的用量统计网格从 8 张卡片升级为更美观对称的 10 卡片布局。</li><li>**高级用量指标统计**：新增对缓存命中率 (Cache Hit Rate) 及生成速度 (Average Speed) 的多维度计算与动态展示。</li></ul> |
| **v2.1.7** | <ul><li>**Gemini 思考模式签名支持**：完美支持 Gemini 思考模式 (thinking mode) 及思维链签名 (thought_signature)，防止转发时出现 400 校验异常并拦截 API Key 泄露。</li><li>**系统级调试日志面板**：引入运行时一键切换的系统调试日志，与 Web 控制台深度集成，提供实时请求响应细节。</li></ul> |
| **v2.1.2** | <ul><li>**状态栏 Token 缓存计数**：支持 CLI 状态栏 (statusline) 中的 Token 计数正确显示缓存命中详情，并在响应速度及文字格式上完成多项优化。</li></ul> |
| **v2.0.87** | <ul><li>**Web 控制台额度支持**：正式打通并适配智谱 GLM 与百炼 Qwen 等主流渠道的额度使用详情实时分析。</li><li>**健康失败记录优化**：修复 HTTP 429 速率限制请求在健康监测系统中未被记录为失败并导致熔断延迟的 Bug。</li></ul> |

| **v2.3.2400** | <ul><li>**SSE 误标 JSON 的多层彻底修复**: v2.3.2397–2399 只看首个 chunk,遇空首块/心跳(`: ping`)/分片(`ev`/`ent:`)仍误判报错;现改为累积多 chunk 判定,并统一修复 formatResponse、两个 transformer、hidden-error-check 与 validateStreamingResponse 四处,误标 SSE 全部按流式透传。</li></ul> |

| **v2.3.2402** | <ul><li>**formatResponse SSE 识别放宽**: 之前仅对 `application/json` 头 peek,上游用非标准 Content-Type(`text/plain`/空)返回 SSE 仍会报 non-JSON;现对任何非流式响应都先 peek 判 SSE。</li></ul> |

| **v2.3.2403** | <ul><li>**修复 Pi 项目级路由未生效**: Pi 项目接管不再复用无法标识项目的全局 `ccr` provider；每个项目改用携带受管项目 ID 的独立 provider，服务端直接加载对应项目 Router。旧接管会自动迁移，关闭全局 Pi 接管不会破坏项目接管，无效映射也不会静默回落到全局模型。</li></ul> |
| **v2.3.2404** | <ul><li>**opencode provider 默认携带 x-opencode-session 会话头**: OpenCode Go 端点强制要求 `x-opencode-session`（缺失直接 400），而 CCR 非透传模式重建上游请求时只带 `Authorization`，客户端会话头全部丢弃，导致 opencode go 供应商（如 `omen-alpha`）全部 400。opencode transformer 现按优先级复用稳定会话 ID：客户端原生 `x-opencode-session` 头 → client adapter 提取的 Claude Code 会话 ID（`metadata.user_id`）→ 请求体兜底提取 → Codex 原生 `session_id` 头 → 回退每请求 UUID；同一会话内值稳定，命中 Go 的路由与 prompt cache 优化。</li></ul> |

## English

| Version | Release Details |
| --- | --- |
| **v2.3.2399** | <ul><li>**Bypass-mode fallback for SSE mislabeled as application/json**: Bypass providers skip the transformer chain entirely, so an SSE body with a JSON Content-Type reached formatResponse and still threw non-JSON; formatResponse now peeks the body and streams actual SSE through — the final catch-all for this issue.</li></ul> |
| **v2.3.2398** | <ul><li>**Fix Codex relay SSE mislabeled as application/json losing content**: Completes the v2.3.2397 fix missed in `OpenAIResponsesTransformer` — an SSE body with an `application/json` Content-Type no longer throws a `non-JSON` error; the body is peeked and passed through as SSE.</li></ul> |
| **v2.3.2397** | <ul><li>**Fix SSE responses mislabeled as application/json no longer lose content**: When a Codex relay or OpenRouter error response returns an SSE body with an `application/json` Content-Type, the Anthropic transformer previously treated it as non-stream JSON and threw. It now peeks the body and routes actual SSE (`event:`/`data:`/`: ` prefix) through the stream converter, only parsing genuine JSON; line-start matching avoids false positives on JSON with `event` fields.</li></ul> |
| **v2.3.2396** | <ul><li>**Fix OpenRouter SSE being parsed as JSON**: Final responses are now classified by their actual Content-Type, and transformer JSON parsing includes a raw-response preview on failure; `stealth/ox-alpha` responses beginning with `: OPENROUTER PROCESSING` no longer surface only as `Unexpected token ':'`.</li><li>**Fix OpenCode Go multi-turn thinking cache breakpoint**: Historical assistant `thinking` is replayed as `reasoning_content` plus its signature, preventing cache matching from stopping before the first thinking turn (often around 64k) and avoiding `reasoning_content must be passed back` 400s. A direct 181k-token repeat request verified a 99.88% upstream hit.</li><li>**Edit custom transformer parameters in place**: Parameter rows now have an edit action that loads the key/value back into the inputs; nested JSON, booleans, and numbers can be changed and overwritten by key without deleting and retyping them.</li></ul> |
| **v2.3.2395** | <ul><li>**UI transformer parameters support nested JSON/boolean/number**: Parameter values were always stored as strings, which `customparams`' deep merge cannot apply — structured values (e.g. `{"enabled":true,"effort":"max"}` for mandatory-reasoning endpoints) configured in the UI had no effect. Values are now parsed by type (malformed JSON keeps the raw string), and parameter display no longer shows `[object Object]`.</li></ul> |
| **v2.3.2394** | <ul><li>**Strict project routing no longer returns 503 solely for a fail-pooled target**: When the project's configured target is unavailable only because of the health fail-pool and no backup model is available, CCR bypasses the health check and sends the request to that same project model so the client sees the real upstream result. Missing, disabled, malformed, or quota-exhausted targets still reject; no project-boundary escape is allowed.</li><li>**Fixed non-stream TTFT and token-speed statistics**: Non-stream responses no longer report total duration as TTFT (shown as `-`); speed is output tokens ÷ total duration, and fake TTFT values no longer pollute the average.</li></ul> |
| **v2.3.2393** | <ul><li>**Project takeover caps the context window per the project Router**: Project takeover previously wrote the auto-compact window from the global Router/ContextWindow only, so when the global family enabled `[1m]` but the project did not enable extended context, the project kept a >200k window and had no usable model once context passed 200k. Now the managed window caps at `min(ContextWindow, 200000)` when the project's default family (or top-level `enableExtendedContext`, when family routing is explicitly disabled) is off, stale `[1m]` aliases are removed, and saving a project Router or the global config refreshes custom-Router projects' takeover. Hand-written windows and state audit behavior are unchanged.</li><li>**opencode go cache hits restored from 0%**: The zen upstream's prompt cache is gated on explicit `cache_control` markers (verified: ~98% hit from the second request with markers, never without); the transformer previously stripped them all, so the upstream never cached. Markers are now preserved, and usage mapping falls back to DeepSeek-style `prompt_cache_hit_tokens` when `cached_tokens` is absent.</li></ul> |
| **v2.3.2392** | <ul><li>**Usage by-day bucketing uses local timezone**: `byDay` used the UTC date, so requests in the local 0:00–8:00 window (whose UTC instant is still "yesterday") were filed into the previous day — visible as "yesterday's usage keeps growing after midnight while today's looks low". Switched to `date(timestamp,'localtime')`; aggregation runs at query time, so historical rows re-bucket correctly without migration.</li></ul> |
| **v2.3.239** | <ul><li>**Provider slow-network probes & yellow ⚠️ warnings**: Background reachability probes against each provider's `/models` endpoint now record latency; when it exceeds `PROBE_SLOW_THRESHOLD_MS` (default 3000ms) the provider card shows a yellow ⚠️. `GET /api/providers/health` adds `probes`, and manual probes return latency/status/isSlow. A slow-but-successful probe never opens the circuit breaker — UI cue only.</li><li>**Usage summaries aggregated in SQL, UI no longer randomly stalls**: `/api/providers/quota` and `/api/usage` summaries used to `SELECT *` every matching row and aggregate in JS, blocking the event loop — the shared root cause of random health/quota stalls. Now uses SQL `COUNT/SUM/AVG/GROUP BY` with identical semantics.</li><li>**Refresh loops reworked, no more overlapping requests**: Providers health/quota is now a 60s self-scheduling single-flight loop; Usage is a 30s serial queue (the next refresh waits for the previous one to settle); `/api/clients` refreshes only on mount (actions reuse the response, no visibility refetch); loops pause while the tab is hidden.</li><li>**Image routing root-cause fix**: The image agent rewrote `req.body.model` before routing, so usage records lost the real client model (e.g. ccr-opus) and bypassed family image routing. Images now route from the client's original model. Also fixes `promoteToolResultImages` replacing every array-shaped tool_result.content with a placeholder and dropping text/structured blocks.</li><li>**Removed deprecated Codex multi-account management**: Drops the account list, switching, background auto-maintenance and its API/CLI/UI. Codex remains fully supported as a regular provider/client (detection, `/v1/responses`, transformer, takeover, usage attribution); historical account files and `~/.codex/auth.json` are left untouched.</li><li>**Routing precedence: family first, then explicit `provider,model`**: With family routing on, requests try the model family mapping first and use it on hit; only when no family matches does it parse the client's explicit `provider,model`, falling back to default routing last.</li></ul> |
| **v2.3.238** | <ul><li>**Auto-restart service after update**: `performUpdate` returned "please restart" but never restarted, so the running process kept the old version and `checkForUpdates` kept reporting an update until a manual `ccr restart`. It now reuses the `/api/restart` self-restart pattern to restart automatically once `npm install -g` succeeds; the UI polls `checkForUpdates` and reloads once `hasUpdate:false` to pick up the new frontend bundle.</li><li>**Concurrent-install guard**: a module-level `updateInProgress` guard prevents a page refresh that loses the in-flight UI state from triggering a second `npm install -g`.</li><li>**Timeout hint names the package**: `app.update_timeout` now says "run `npm install -g @wengine-ai/claude-code-router-next@latest` manually" so a copy-paste actually works.</li></ul> |
| **v2.3.237** | <ul><li>**Update progress feedback with bounded wait time**: Clicking “Update Now” disables the dialog actions and shows an “Updating…” state to prevent duplicate installs. Both the frontend request and backend `npm install -g` have a 5-minute timeout, backend output buffering is raised to 4 MB, and timeouts surface a readable error instead of hanging forever.</li><li>**Lean Claude project guidance**: Removes always-loaded instructions that are directly derivable from manifests, CLI help, and repository structure while retaining non-obvious safety, release, and architecture constraints, reducing fixed context cost per session.</li></ul> |
| **v2.3.236** | <ul><li>**Aliyun Token Plan quota (5h/7d)**: Adds a dedicated `AliyunTokenPlanQuotaAdapter` for `*.maas.aliyuncs.com` hosts, querying the Token Plan usage API via BroadScope POST and mapping `per5HourPercentage`/`per1WeekPercentage` to 5h/7d percentage display.</li><li>**`quota_sec_token` config + official gateway with legacy fallback**: Optional `quota_sec_token` provider field and UI password input switch to the official `bailian-cs.console.aliyun.com` gateway (aligned with the real console request: literal `_v=undefined`, dynamic trace, no spm), falling back to the cookie-only `cs-data` endpoint on failure.</li><li>**pi extended-context unified to absolute threshold**: Drops pi's `extendedContextRatio` in favor of the shared absolute chain (family → Router → 200000).</li><li>**Test HOME isolation now reaches vitest workers**: Fixes the core/shared suites previously running against the real `~/.claude-code-router`.</li></ul> |
| **v2.3.235** | <ul><li>**Fix npm global installation failing silently**: The published `@wengine-ai/llms` package previously retained its runtime shared dependency as pnpm's `workspace:*` protocol, which npm cannot parse and exited 1 while resolving the dependency tree. The release flow now publishes the matching `@wengine-ai/claude-code-router-shared` version first, rewrites every core `workspace:` range to a real npm version range before publishing core, then publishes the CLI. All three shared/core/CLI publish manifests are blocked if any `workspace:` range remains, preventing another npm-uninstallable release.</li></ul> |
| **v2.3.234** | <ul><li>**Fix: global ContextWindow changes not propagated to taken-over projects (frozen auto-compact window)**: When a project was taken over before v2.3.22 or went through a disable→enable cycle that left `ccr-state.json` missing, `CLAUDE_CODE_AUTO_COMPACT_WINDOW` got stuck on a stale value (e.g. 200000). The previous guard misclassified that stale value as a user hand-edit and kept it forever, so no later global `ContextWindow` change took effect and toggling takeover in the UI couldn't refresh it either. The field is now re-treated as CCR-managed when state is missing: it writes the current global value and rebuilds state, recording the displaced old value into `previousAutoCompactWindow` for audit. With state present, the original v2.3.22 guarantee is preserved — a divergent value is still treated as a user customization and left untouched.</li></ul> |
| **v2.3.233** | <ul><li>**Fix "Update Now" failing with 404**: The UI `ApiClient` already uses `/api` as its `baseUrl`, but `performUpdate()` passed `/api/update/perform`, producing `/api/api/update/perform`. Now `/update/perform`, so the request correctly hits the server's `/api/update/perform`.</li><li>**Fix update dialog always showing "no changelog available"**: `checkForUpdates` previously always returned an empty `changelog`. When a newer version is detected it now extracts that version's summary from the published npm package README first, falling back to the matching GitHub `CHANGELOG.md` section if absent; only the existing fallback text is shown when both sources fail, and network errors do not break the version check.</li></ul> |
| **v2.3.232** | <ul><li>**Strict Project Routing Is Now an Authoritative Boundary**: Once a project has a non-empty `Router`, missing, malformed, disabled, unhealthy, or quota-exhausted targets return stable errors instead of silently falling back globally. Explicit project-internal fallback still works, while global/custom routers, inherited global fallback, client overrides, and subagent model overrides can no longer escape the project boundary.</li><li>**Provider-Level Proxy Policy**: Adds top-level `PROXY_GLOBAL_ENABLED` and per-provider `proxy_enabled`; with global mode off, only opted-in providers use the shared `PROXY_URL` while all others connect directly. Unconfigured or enabled preserves the legacy proxy-all behavior. Inference, fallback, health probes, quota queries, wakeup, and provider API tokenizer calls all follow the same policy.</li><li>**Proxy Safety Validation and UI Controls**: Config saves accept only `http://`, `https://`, empty values, or environment-variable placeholders; invalid protocols and malformed URLs are reported per key without overwriting the existing config. Settings gains an “Apply Globally” switch and provider cards gain individual proxy toggles with a trusted-proxy warning. ProxyAgent instances are pooled by URL, released on shutdown, and credentials are redacted from logs.</li><li>**Per-Client Adapters and pi Context Routing**: The CCR runtime moves into core and adapters unify client-specific behavior across Claude Code, Codex, pi, qwen-code, and opencode. pi gains `extendedContextRatio` (80% default), stops emitting/consuming `[1m]`, and uses the absolute threshold chain for longContext.</li><li>**Strict-Routing, Client-Detection, and Usage Fixes**: Malformed project targets no longer escape globally; Codex Responses requests are no longer misclassified as Claude Code; fixes non-stream `upstreamModel` loss, failed requests reusing predecessor tokens, `response.completed` zeroing the usage merge base, and project-routing errors clearing the session usage baseline.</li><li>**Runtime Lifecycle and Error-Handling Fixes**: `createCcrServer({ port })` now honors its port, 401/403 auth no longer leaves pending promises, listening waits for provider/transformer/tokenizer initialization, and preset registration failures are no longer silently swallowed.</li></ul> |
| **v2.3.231** | <ul><li>**Project-Level Takeover Defaults to Claude Code Only**: Enabling a project's "CCR Takeover" previously took over all supported clients (Claude Code, pi, qwen-code, opencode) by default, writing `.pi/settings.json`, `.qwen/settings.json` and `opencode.json` into the project directory (opencode additionally generates `AGENTS.md` on its first run), polluting the project root; every default path (master switch, cleared multi-select, legacy `enabled: true`) now takes over Claude Code only, with the other clients strictly opt-in via the multi-select.</li><li>**Fix "Check for Updates" Always Reporting Up-to-Date (Double Bug)**: The backend `checkForUpdates`/`performUpdate` hardcoded the old, since-unpublished npm package name `claude-code-router-next`; the `npm view` 404 was silently swallowed by the catch block so it always returned "no update", and "Update Now" failed to install for the same reason. The package name is now read dynamically from `package.json` (`@wengine-ai/claude-code-router-next`), so future renames can't break it. Separately, the UI update dialog required a non-empty `changelog` while the backend always returns an empty string, so the dialog never opened even when a newer version existed — that check is removed (the dialog already has a "no changelog available" fallback).</li><li>**Release Gate**: `scripts/release.sh` adds `validate_release_docs`, enforced before anything ships (including dry-run): all 6 `package.json` versions must match the release version, `CHANGELOG.md` must have a non-empty section for it, both README tables must have its row, and the version must be strictly greater than the latest published on npm (numeric per-segment compare; skipped with a warning if the registry is unreachable). Any failure aborts the release.</li><li>**Version Numbering Policy: Multi-Digit Patch for Daily Iterations**: Starting with this release, daily iterations extend the patch segment with an extra digit (`2.3.23` → `2.3.231` → `2.3.232`) to keep headline numbers from inflating; patch segments compare numerically, so after `2.3.23x` the next feature version is `2.3.240` (`2.3.24` would be rejected as a downgrade by the gate), or bump the minor to `2.4.0`.</li></ul> |
| **v2.3.23** | <ul><li>**Fix Inflated Status Line Token Speed (Hitting the 999 Cap)**: `ccr statusline` often showed a token speed in the hundreds (occasionally hitting the 999 cap), inconsistent with the ~tens of tok/s on the Usage Stats page. The token-speed plugin reported a sliding-window value ("tokens arrived in the last 1s") on each streaming tick, but SSE deltas arrive in bursts (proxy/network buffering stamps many tokens at the same instant), so the instantaneous count spiked and did not reflect the real sustained decode rate. Interim streaming updates now use the same decode-average formula as the usage store (`output tokens ÷ (total time − TTFT)`), so the rate converges to the final value and matches Usage Stats; the now-unused sliding-window bookkeeping was removed.</li><li>**Status Line Defaults to an Icon-less Table Style**: The default theme no longer carries decorative icons; modules are separated by a thin vertical bar `│` (U+2502) for a clean table look, with the default modules ordered as model │ working dir │ git branch │ context bar │ token speed │ session total tokens. Motivation: ambiguous-width emoji icons (e.g. the lightning bolt `⚡` U+26A1) made Claude Code mis-measure the status line width and leave redraw artifacts (digits duplicating/shifting on interaction such as double-click); width-stable glyphs or no icon avoid it. Icons remain fully customizable in the UI.</li><li>**Fixed Undeletable Status Line Icons + Legacy Circle Migration**: When switching the selected module, the icon search box (`IconSearchInput`) did not sync with the `value` prop, desyncing from the module's real icon so icons looked undeletable — it now syncs on `value` change; also, legacy `contextCircle` modules are migrated to `contextBar` on load so the dialog shows the progress bar instead of the old circle icon.</li><li>**`build:ui` Syncs Artifacts to CLI/root dist**: `pnpm build:ui` now copies the freshly built `index.html` into `packages/cli/dist` and root `dist`, so running `build:ui` standalone updates the bundle the locally-running ccr actually serves.</li></ul> |
| **v2.3.21** | <ul><li>**New pi (earendil-works) Client Takeover**: Adds pi as a third takeover target alongside Claude Code and Codex. pi speaks the Anthropic `/v1/messages` protocol, so ccr connects directly with no transformer; takeover writes `models.json` and `settings.json` under `~/.pi/agent`, backing up the originals — config-injection only, no account management. Usage stats tell pi apart by its system-prompt signature plus Anthropic SDK request headers.</li><li>**Project-Level Takeover Supports Multiple Clients**: The Projects page "CCR Takeover" changes from Claude-Code-only to a multi-select of clients (Claude Code + pi + qwen-code + opencode); leaving it empty takes over all supported clients. pi's project-level takeover writes `.pi/settings.json` in the project and trusts the folder in `trust.json`.</li><li>**New qwen-code (Alibaba) Client Takeover**: Adds qwen-code as a fourth takeover target over the Anthropic `/v1/messages` protocol. Takeover writes a ccr-pointed `modelProviders.anthropic` into `~/.qwen/settings.json` (user) / `<project>/.qwen/settings.json` (workspace) and `trustedFolders.json`, backing up the original. Usage stats detect qwen-code by its system-prompt signature (qwen spoofs Claude Code's UA when proxied).</li><li>**New opencode (opencode.ai) Client Takeover**: Adds opencode as a fifth takeover target over the Anthropic `/v1/messages` protocol. Takeover injects an `@ai-sdk/anthropic` `provider.ccr` in `~/.config/opencode/opencode.json` (global) / `<project>/opencode.json` (project), backing up the original; no trust gate. Usage stats detect opencode by its non-spoofed `opencode/…` User-Agent.</li></ul> |
| **v2.3.20** | <ul><li>**Prune orphaned circuit-breaker states after renaming/removing models**: Renaming or removing a model from a provider previously left stale breaker records in `provider-health.json`, keeping the provider shown as `Failed` even after restart or refresh. A new `health-reconcile` pass cleans stale records on startup, config save, and successful probes while preserving valid models referenced only through Router/fallback.</li></ul> |
| **v2.3.19** | <ul><li>**New OpenCode (opencode.ai) Transformer**: Adds a dedicated transformer for OpenCode-style providers that expose an OpenAI-compatible `/v1/chat/completions` endpoint backed by GLM/Zhipu models. It declares `endPoint` explicitly so a provider whose only resolved transformer is `AnthropicTransformer` no longer triggers bypass mode and sends Anthropic-format tools to an OpenAI-compatible API; it also strips `cache_control`/`image_url`/`media_type` fields GLM does not understand, converts `reasoning_content` into the thinking format Claude Code expects, and replaces purely-numeric `tool_call` IDs with UUIDs. Enable it by adding `"opencode"` to a provider's `transformer`.</li><li>**Disable Browser Autofill on Proxy URL & API Key Inputs**: The Proxy URL and API Key inputs in both the dialog and full-page Settings were being overwritten by Chrome's saved form data/password autofill. The `Input` component now supports `disableAutofill`, providing a triple guard — a randomized `name` per mount so the browser cannot match saved data, an initial `readOnly` state released on first focus to skip autofill, and `autoComplete="off"` plus password-manager ignore attributes — alongside a hidden honeypot field.</li></ul> |
| **v2.3.18** | <ul><li>**Family Long-Context Threshold Inherits Main Router Config**: When `ccr-opus`/`ccr-sonnet`/`ccr-haiku` enter family routing and no family-specific threshold is configured, CCR now inherits `Router.longContextThreshold`, avoiding cases where a global 100k threshold still routed ~70k-token requests to `<family>/longContext` because the code defaulted to 60k.</li><li>**Double-Check Retry for Fallback Candidates**: Each fallback candidate now retries once after an initial `fetch failed`, empty SSE, or hidden upstream error before moving to the next candidate, reducing premature model switching when providers such as Zhipu are briefly unstable; failed fallback usage records now keep the client-requested `originalModel`.</li><li>**Sync Project CCR Takeover Fields After Global Config Saves**: Projects that follow the global Router and have CCR Takeover enabled now refresh their `.claude/settings.local.json` managed fields — model-family aliases, auto-compact window, status line, proxy URL/token — when the global config is saved or when the project switches back to global configuration.</li><li>**Reduce Default Log Volume and Keep 7 Days**: Server logs now default from `debug` to `error`, detailed logs are emitted only when `LOG_LEVEL=info/debug/trace` is explicitly configured, and `ccr-*.log` files older than 7 days are cleaned automatically.</li></ul> |
| **v2.3.17** | <ul><li>**Fix Invalid URL on Every Fallback Model**: When the primary model rate-limited (e.g. Zhipu plan) and fallback kicked in, every backup model previously errored with `Invalid URL`. Root cause: the fallback path used the raw `ConfigProvider[]` (field `api_base_url`, no `baseUrl`) while `sendRequestToProvider` builds the upstream URL from `provider.baseUrl` — `new URL(undefined)` threw for each fallback. Switched to `providerService.getProviders()` (registered `LLMProvider[]` with `baseUrl`).</li><li>**Fix Fireworks-Hosted Usage Stats All Zero**: Fireworks streaming emits the real usage in a `choices: []` chunk *after* the `finish_reason` chunk, and the `finish_reason` chunk itself carries `usage=null`. The streaming transformer lost it two ways: the finish block overwrote the already-merged real usage with the finish chunk's null usage (zeroing `output_tokens`/`cache_read`), and a `break` after finish discarded the trailing usage chunk entirely — so DB recorded `input` with a value but `output`/cache-hit as 0 for fully-completed requests. Fixed: the loop now continues past finish (content paths are `!hasFinished`-guarded so no duplicate output), the finish block only sets `stop_reason` and never touches usage, and `break` became `hasFinished = true`. Also fixed three downstream usage-capture layers (transformer overwrite, per-frame spread-merge, `??` not falling back on 0) by extracting `mergeUsageCapture` with `||` fallback so a zeroed frame can't wipe input.</li><li>**Ignore Stale Routes of Deleted Models to Prevent Health-Pool Pollution**: After a model is removed from a provider's config, leftover `provider,model` strings in routing and fallback were still treated as valid candidates, repeatedly failing and polluting the health (fail) pool so unrelated fallback models got skipped. `resolveConfiguredModel` now returns `null` for unmatched candidates, the fallback loop validates a model exists before attempting it, and `ProviderHealthStore` rejects empty provider/model keys to stop malformed keys polluting the pool; extracted a shared `findProviderModel` helper.</li></ul> |
| **v2.3.16** | <ul><li>**Fix System Message Ordering for DeepSeek/vLLM**: OpenAI-compatible providers (DeepSeek V4, GLM, vLLM) require `[system, user, assistant]` order; placing system after user/assistant previously produced garbled output. System messages are now hoisted to the front and deduped.</li><li>**Strip Attribution Header on Takeover for Cache Hits**: When CCR takes over Claude Code it now writes `CLAUDE_CODE_ATTRIBUTION_HEADER=0` by default, removing the per-request attribution header (client version + prompt fingerprint) at the start of the system prompt so the upstream prompt-cache prefix stays stable. Disable via Settings or `disableAttributionHeader: false`.</li><li>**Compact Settings Page Layout**: The log-level dropdown is moved from a full-width row into the two-column grid, now shown side-by-side with the API key to reduce vertical whitespace.</li></ul> |
| **v2.3.15** | <ul><li>**Retry Same Model Once Before Fallback (Double-Check)**: A single provider error no longer triggers an immediate model switch. CCR now automatically retries the same model once — transient errors (network jitter, momentary rate-limit, empty SSE) often resolve on a second attempt. Only if the retry also fails does it fall back to a backup model.</li><li>**Usage Stats Show Upstream's Real Model**: Some upstream gateways silently route/downgrade a request to a different backend model (e.g. requesting glm-5 but actually returning MiniMax-M2.5). The model-mapping column in usage stats now appends the model the upstream actually returned, formatted as `originalModel → routedModel → upstreamModel` (e.g. `ccr-opus → glm-5 → minimax-m2.5`); the upstream leg is omitted automatically when it matches the routed model (no swap).</li></ul> |
| **v2.3.14** | <ul><li>**Fix Status Line Showing `<synthetic>` as the Model**: Synthetic `<synthetic>` messages written by Claude Code during auto-compact / interruption recovery (not real LLM responses) were previously picked up as the model name in the status line (most visible after switching from a Claude account session to ccr, or after an auto-compact); they are now filtered out so the actually-routed model is displayed, and their usage is no longer counted toward token stats.</li></ul> |
| **v2.3.13** | <ul><li>**Fix Project Deletion Leaving ccr Fields in `settings.local.json`**: Adding a project auto-writes ccr-managed fields (proxy URL, model family routing env vars, auto-compact, status line) into the project's `.claude/settings.local.json`, but deleting the project previously left them behind; deletion now disables takeover first to remove those fields.</li></ul> |
| **v2.3.12** | <ul><li>**Fix Scheduled Wake-up Not Triggering Billing Cycle**: Wake-up requests now use a real reasoning prompt with `max_tokens: 10` instead of a dummy `max_tokens: 1` ping, ensuring Coding-Plan-style providers record actual token usage and activate the daily quota cycle.</li><li>**Fix Codex `/messages` Endpoint Wake-up 404**: Anthropic protocol is now detected by checking whether `baseUrl` contains `/messages`; the configured `baseUrl` is used as the full endpoint path without appending any suffix.</li><li>**Add Source Headers to Wake-up/Probe Requests**: Adds `x-claude-code-router-source` and `x-claude-code-router-version` headers so upstream services can identify CCR internal wake-up/probe traffic.</li></ul> |
| **v2.3.11** | <ul><li>**Fix First Request of a New Session Bypassing Project Routing (Session Detection Race)**: The first request of a new session (e.g. the title-generation meta request, which arrives ~tens of ms before the main request) could land before the session transcript file is flushed to disk, so project matching failed and it fell back to the global `Router` — bypassing project-level routing (e.g. a project with `enableFamilyRouting` off still went through global family routing). On a cache miss the lookup now retries briefly (up to 3×50ms) to give the file time to appear, and retries only once per session so un-managed sessions don't pay the delay on every request.</li></ul> |
| **v2.3.10** | <ul><li>**Fix Title-Generation Requests Triggering `think` Routing**: `thinking: {type: "disabled"}` is a truthy object and was previously misread as "thinking enabled", routing the request to the `think` model; now only `thinking.type === "enabled"` enters the `think` scenario, so projects with family routing disabled no longer get routed to the global think model.</li><li>**Fix Empty Model When Default Is Unhealthy With No Fallback**: When `Router.default` is unhealthy (fail-pool) and no fallback is available, it previously returned an empty model, causing a synthetic "provider not found" error; it now retries the configured default model with the health check skipped as a last resort, so Claude Code gets a real upstream response to retry on.</li></ul> |
| **v2.3.9** | <ul><li>**Codex Managed Account Token Auto-Refresh**: Adds a background scheduler (first run 60s after startup, then every 30 minutes) that checks every managed Codex account — active or not — and proactively refreshes it once its `access_token` is within 24 hours of expiry or it hasn't been refreshed in 7 days, exchanging the stored `refresh_token` and writing the result back to the account store; if the account is currently active, `~/.codex/auth.json` is backed up and synced as well. Can be disabled via `Clients.codex.autoRefreshTokens` (enabled by default).</li><li>**Fix Runtime Fallback Retry Ignoring Project-Level `enableFallback`**: When an in-flight request failed (e.g. rate limit) and triggered a retry fallback, it previously read the global `Router.enableFallback` and global top-level `fallback` config directly, ignoring a project's `enableFallback: false` and custom `Router.fallback`. The runtime retry now uses the same project-resolved fallback config as the routing decision.</li></ul> |
| **v2.3.8** | <ul><li>**Configurable Context Window**: Adds `ContextWindow` in Settings to drive Claude Code / Codex takeover auto-compaction, defaulting to 200000 tokens.</li><li>**Codex Auto-Compact Window Sync**: Codex takeover now writes `model_context_window` and `model_auto_compact_token_limit` (~90%) for CCR aliases, so compaction triggers before the routed model overflows.</li><li>**Project Routing Session Detection Fix**: Handles JSON/object/legacy `metadata.user_id` session formats and caches only successful project matches, avoiding stale misses when the session file is created after the first routed request.</li><li>**Family-Alias Routing Bypass Fix**: When `enableFamilyRouting` is disabled, `ccr-opus`/`ccr-sonnet`/`ccr-haiku` are no longer intercepted by a stale `Router.models` alias mapping and correctly fall back to the project's custom scenario routing.</li></ul> |
| **v2.3.7** | <ul><li>**New Projects Default to Takeover + Follow Global**: Adding a project on the Projects page now enables both "CCR Takeover" and "Use Global Configuration" by default, automatically writing the ccr proxy config and keeping the project's routing in live sync with the global router — new projects work out of the box.</li><li>**Project Fallback Copy Fix**: Customizing a project's router now correctly copies the global top-level `fallback`, avoiding loss of fallback model chains.</li><li>**Takeover Model Sync Fix**: Toggling takeover now regenerates managed fields from the *current* global config, so re-enabling after a global change picks up the latest model routing while preserving non-managed `permissions`/`hooks`.</li></ul> |
| **v2.3.6** | <ul><li>**Per-Project CCR Takeover**: The Projects page now has a "CCR Takeover" toggle that writes `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN`, model family routing env vars, auto-compact settings, and the status line command into that project's `.claude/settings.local.json`, so Claude Code CLI in that project routes through CCR directly without `ccr code`. Disabling takeover backs up the current settings so re-enabling restores them, avoiding loss of personalized configuration.</li><li>**Projects Page Collapse & Sync Fix**: Project cards can now be collapsed/expanded; turning off "use global configuration" now correctly syncs the global router's fallback and model family settings.</li></ul> |
| **v2.1.36** | <ul><li>**Latest Codex RT Export**: Codex account management can now export the latest refresh token for the active or a selected managed account. The CLI adds `ccr clients codex export-rt [account-id]`, the Web UI adds copy-RT actions, and managed snapshots are synced when the current auth file is newer.</li></ul> |
| **v2.1.35** | <ul><li>**Scheduled Wake-up Stability Fix**: Provider scheduled wake-up now recalculates the next trigger after macOS sleep/wake or system clock jumps, avoiding missed or duplicate wake-up runs.</li></ul> |
| **v2.1.34** | <ul><li>**Local Client Configuration Management**: Adds Client Configuration management for enabling, disabling, or restoring local Claude Code, Codex, and other client configs through the UI/API/CLI, automatically writing CCR proxy URLs and model aliases.</li><li>**Codex Local Account Management**: Adds a Codex account management page and `ccr clients codex` commands for importing the current signed-in account, importing by refresh token, switching the active account, deleting managed accounts, and backing up/replacing the official auth file.</li><li>**Codex Account List Cache**: Codex accounts now load from persisted local account and quota cache first, so page refreshes no longer wait for the official usage API; the active account refreshes in the background every 1 minute and inactive accounts every 30 minutes.</li><li>**Codex / OpenAI Responses API Compatibility**: Adds the `openai-responses` Transformer so Codex can use the Responses API wire format through CCR, including streaming and non-streaming conversion between Chat/Anthropic and Responses formats.</li><li>**Status Line Visual Upgrade**: Adds a gradient-colored Context usage progress bar to make long-context usage easier to read.</li></ul> |
| **v2.1.32** | <ul><li>**Provider Refresh Button Placement**: Moves the single-provider refresh button into the top status row beside the enable switch, leaving edit and delete in the hover action area.</li></ul> |
| **v2.1.31** | <ul><li>**Provider Actions Layout**: Makes the provider card refresh, edit, and delete actions compact and horizontal, avoiding the stretched vertical action column.</li></ul> |
| **v2.1.30** | <ul><li>**Codex Multi-Account Quota Display**: Adds official quota information to Codex account management, using `chatgpt.com/backend-api/wham/usage` to display 5-hour rate-limit and 7-day weekly-limit usage percentages and reset times.</li><li>**Codex Account Auto-Switching**: Checks official quota before each Codex request and switches to the next available account when any window reaches the default 95% threshold, while keeping the existing 429/rate-limit fallback switch.</li></ul> |
| **v2.1.27** | <ul><li>**DeepSeek / GLM Tool Calling Compatibility Fix**: Fixes request failures against some DeepSeek and GLM compatible APIs caused by incompatible `tool_choice` parameter formats.</li></ul> |
| **v2.1.26** | <ul><li>**Fix Anthropic Transformer URI Override**: When `Anthropic` is combined with DeepSeek/OpenAI-compatible providers, it no longer rewrites `chat/completions` endpoints to `/v1/messages`, preventing DeepSeek 404 responses.</li><li>**Tighter Protocol Conversion Boundary**: Request bodies are converted to Anthropic messages format only when the provider `api_base_url` explicitly points to a `/messages` endpoint.</li></ul> |
| **v2.1.25** | <ul><li>**Fix Claude Code (v2.1.154+) 422 Error**: Solves the 400/422 validation errors when calling Anthropic-compatible `/v1/messages` target providers due to `role: "system"` appearing in the messages array.</li><li>**Self-Healing Passthrough Protection**: Blocks passthrough bypass for requests containing system messages, enforcing symmetric protocol normalization and system parameter extraction.</li><li>**Response Passthrough Fix**: Passes original Anthropic-compatible responses through unchanged, resolving the issue where requests succeeded but returned empty/no content.</li></ul> |
| **v2.1.22** | <ul><li>**Provider Scheduled Wake-up**: Introduces a global and provider-level scheduled reset/wake-up mechanism to activate provider quotas early in the morning by sending dummy requests.</li><li>**Symmetric Web UI Grid**: Upgraded the usage statistics grid on the dashboard from 8 cards to a symmetric 10-card layout.</li><li>**Advanced Usage Metrics**: Added real-time displays and calculations for Cache Hit Rate and Average Speed (tok/s).</li></ul> |
| **v2.1.7** | <ul><li>**Gemini Thinking Mode & Signature Support**: Cleanly supports Gemini thinking mode and handles thought signatures, preventing 400 validation failures and blocking API key leaks.</li><li>**Runtime Debug Logging**: Introduced a system debug logging system with one-click toggles and Web UI integration for easier troubleshooting.</li></ul> |
| **v2.1.2** | <ul><li>**Status Bar Cache Tokens**: Fixed the CLI statusline token count display to correctly account for cache hits, and implemented multiple visual/speed optimizations.</li></ul> |
| **v2.0.87** | <ul><li>**Web Console Quota Display**: Fully integrated and displayed real-time Web console quota usage details for Zhipu GLM and Aliyun Qwen.</li><li>**Health Store Failure Tracking**: Correctly recorded HTTP 429 Rate Limit responses as health check failures to trigger fallback mechanism early.</li></ul> |
| **v2.3.2400** | <ul><li>**Thorough multi-layer fix for SSE mislabeled as JSON**: v2.3.2397–2399 judged from a single first chunk, so an empty leading buffer, heartbeat (`: ping`) or split fragment (`ev`/`ent:`) still misclassified and errored. Detection now accumulates across chunks and is unified across formatResponse, both transformers, the hidden-error-check, and validateStreamingResponse — mislabeled SSE streams through cleanly.</li></ul> |
| **v2.3.2402** | <ul><li>**Broaden formatResponse SSE detection**: Previously peek ran only for application/json Content-Type, so an SSE body with a non-standard Content-Type (text/plain/empty) still threw non-JSON; now any non-stream response is peeked first.</li></ul> |
| **v2.3.2403** | <ul><li>**Fix Pi project routing being ignored**: Pi project takeover no longer reuses a global `ccr` provider that cannot identify the project. Each project gets a dedicated provider carrying a managed project ID, letting the server load that project's Router directly. Legacy takeovers migrate automatically, disabling global Pi takeover preserves project providers, and invalid mappings cannot silently fall back to global models.</li></ul> |
| **v2.3.2404** | <ul><li>**opencode providers now send x-opencode-session by default**: OpenCode Go hard-requires `x-opencode-session` (400 MissingSessionID otherwise), but CCR's non-bypass path rebuilds upstream headers with `Authorization` only, dropping the client's native session header and failing every opencode go request (e.g. `omen-alpha`). The opencode transformer now reuses a stable per-conversation id in priority order: the client's own `x-opencode-session` header, the client adapter's Claude Code session id (`metadata.user_id`), a direct body fallback, Codex's native `session_id` header, then a per-request UUID; the value stays stable within a conversation, unlocking Go's routing and prompt-cache optimization.</li></ul> |
