Skip to content

v0.2.4#194

Merged
ThreeFish-AI merged 44 commits into
masterfrom
feature/1.x.x
Apr 18, 2026
Merged

v0.2.4#194
ThreeFish-AI merged 44 commits into
masterfrom
feature/1.x.x

Conversation

@ThreeFish-AI

@ThreeFish-AI ThreeFish-AI commented Apr 18, 2026

Copy link
Copy Markdown
Owner
  • refactor(vendor-channels): 将供应商转换通道从目标专属重构为源→目标绑定模型;
  • refactor(thinking-strip): 条件化 thinking block 剥离,仅跨供应商场景触发;
  • style(dashboard): 缩小「今日费用估算」卡片费用数字字体使其单行显示;

ThreeFish-AI and others added 30 commits April 16, 2026 11:48
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
将 「今日费用估算」中的费用数字字体改小一下,令其「$41.9106 + ¥33.4842」在一行显示(需要显示完整),从而使这些小卡片的高度都相当,不至于像现在「今日费用估算」的高度严重超过其他卡片 (vibe-kanban)
将 thinking block 剥离从 AnthropicVendor._prepare_request()(无条件执行)
提升至 _RouteExecutor._prepare_body_for_tier()(条件执行),基于请求规范化
信号(has_cross_vendor_signals)和会话历史信号(provider_state)判断是否
需要剥离。纯 Anthropic 会话中 thinking blocks 保持原样以维持上下文连续性。

- 新增 NormalizationResult.has_cross_vendor_signals 属性
- 迁移 strip_thinking_blocks() 至 request_normalizer.py
- 新增 _RouteExecutor._needs_thinking_strip() 条件判断方法
- 补充 count_tokens 端点的安全剥离(无会话上下文时回退到始终剥离)

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
条件化 thinking block 剥离,仅跨供应商场景触发
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
如图「今日费用估算」中的数值的小数点后四舍五入最多保留 2 位有效数值即可。 (vibe-kanban)
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
ci(release): 移除发布流水线中的 Update Changelog 自动化阶段
新增 sortByTierOrder 辅助函数,将请求量趋势、供应商请求分布、Token 量趋势
三个图表的 Legend 排序策略从各自独立的字母序/数量降序统一为 /api/status 返回
的 tiers 优先级顺序,确保图表间视觉语义一致。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
如图所示三个被红框框选的图表中的 Legend 的排列顺序需统一与「供应商状态」中 vendors 的排列顺序保持一致,比如现在的 anthropic -> zhipu -> (vibe-kanban)
…mat 及通用代码卫生检查;

- 新建 .pre-commit-config.yaml:使用 local hook(language: system + uv run)调用 uv.lock 锁定的 Ruff,
  确保本地 hooks 与 CI 流水线使用完全一致的版本(Single Source of Truth);
  并集成 pre-commit-hooks 通用卫生检查(trailing-whitespace、end-of-file-fixer、check-yaml 等)
- pyproject.toml:dev 依赖组追加 pre-commit>=4.0
- uv.lock:同步锁定 pre-commit==4.5.1 及其依赖
- AGENTS.md:卓越运营规范追加第 5 条 Pre-commit Hooks 安装与使用说明

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
feat(pre-commit): 配置 Pre-commit Hooks,实现本地 commit 前自动 lint/format 守护
🤖 Generated with [Claude Code](https://github.com/claude)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
…t 配对修复,以单遍自包含函数替代多步串联管线;

以 `enforce_anthropic_tool_pairing` 单次正向遍历替代原有多步串联管线
(剥离→重定位→孤儿修复),消除步骤间隐式依赖导致的孤儿 tool_use 漏修,
彻底根治 `tool_use ids were found without tool_result blocks` 400 异常。

- 新增 `enforce_anthropic_tool_pairing()` 函数(单遍、自包含、幂等)
- 新增 `_needs_tool_pairing_enforcement()` 扩展触发条件,覆盖会话历史含非 Anthropic 供应商的场景
- 新增 13 个测试用例覆盖全部场景(含真实 bug 复现)

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
fix(request-normalizer): 重设计 zhipu→anthropic 跨供应商 tool_use/tool_result 配对修复
🤖 Generated with [Claude Code](https://github.com/claude)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
将 1,641 行单体 framework.md 拆分为 499 行枢纽文档 + 6 个专题子文档:
- arch/config-reference.md:弹性参数规范来源(SSOT),消除 3 倍重复
- arch/design-patterns.md:13 种设计模式,补充 NativeAnthropicVendor 层级
- arch/vendors.md:供应商分类体系(直接/协议转换/原生兼容),补全 9 个供应商
- arch/routing.md:12 个路由子模块详解
- arch/convert.md:三向格式转换
- arch/testing.md:48 个测试文件按子系统分组

修正:删除不存在的 backends/ 引用,修正 compat_state.db → compat.db

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
…全默认值、routing 子模块计数修正;

- vendors.md / design-patterns.md: 移除 NativeAnthropicVendor 错误的 <<abstract>> 标记(实际为具体基类,子类仅需覆写 _vendor_name 和 _display_name)
- vendors.md: 补充 GoogleOAuthTokenManager 辅助模块文档(内嵌于 antigravity.py)
- vendors.md: 修正 Path B 钩子方法措辞,区分可覆写方法与钩子方法
- config-reference.md / framework.md: FailoverConfig 默认值补全 status_codes 增加 529、error_message_patterns 增加 "internal network failure"
- routing.md: 子模块计数从 13 修正为 12

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
/preening-substrate @docs/framework.md#1-1641 (vibe-kanban)
将 1772 行单体 user-guide.md 正交分解为枢纽文档(~254 行) + 6 个专题子文档:
- guide/vendors.md: 供应商配置(覆盖全部 9 种供应商,含新增 minimax/alibaba/xiaomi/kimi/doubao)
- guide/cli-reference.md: CLI 命令参考(补充 --week/-w, --month/-m, --total/-t, --vendor/-v)
- guide/api-reference.md: HTTP API 端点(补充 Dashboard 端点、count_tokens 501、reset body)
- guide/dashboard.md: Dashboard 看板(全新文档,此前未记录)
- guide/quickstart.md: 快速上手(合并原 §2 + §6)
- guide/monitoring.md: 监控·运维·排查(合并原 §7 + §8 + §9)

语义修正: 默认 tiers 顺序(zhipu-first)、zhipu 已有 circuit_breaker 不再是终端层、
copilot enabled 默认为 true、新增 5 种 NativeAnthropicVendor 文档;
配置详解章节委托给 arch/config-reference.md 消除重复;

枢纽文档 -85.7%(1772→254),总文档 -17.2%(1772→1467),供应商覆盖 +125%(4→9);

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
ThreeFish-AI and others added 14 commits April 17, 2026 23:58
docs(user-guide): 正交分解用户指南为枢纽+专题子文档,校准全部语义偏差
- 新建 convert/vendor_channels.py:prepare_for_zhipu(剥离 thinking+cache_control+thinking 参数+tool pairing)、prepare_for_copilot(剥离 thinking+cache_control+tool pairing)、共享辅助函数;
- 扩展 executor._prepare_body_for_tier() 从仅 anthropic 扩展为按供应商通道路由,新增 _needs_vendor_channel() 统一触发条件;
- 新增 29 个通道函数单元测试 + 2 个 executor 通道路由测试,全量 1257 测试通过;

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
…应商转换通道的多态维护;

- 新增 prepare_for_anthropic() 到 vendor_channels.py,将 executor 中的内联 anthropic 逻辑收敛至专属通道;
- 新增 VENDOR_CHANNELS 注册表 + get_channel() 查表接口,executor 通过注册表分发,不感知具体供应商;
- 统一触发条件:扩展 _needs_vendor_channel() 吸收 has_anthropic_fixes 信号,替代已移除的 _needs_tool_pairing_enforcement / _needs_thinking_strip;
- executor._prepare_body_for_tier() 简化为注册表查表模式,移除 copy import;
- 新增 12 个测试:anthropic 通道(7 个)+ 注册表(4 个)+ has_anthropic_fixes 信号(1 个);
- 全量 1269 测试通过,0 失败;

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
anthropic 通道保持原有宽松策略(Phase 1 信号 + 无会话回退 + 会话历史);
zhipu/copilot 通道改为仅依赖会话历史(provider_state)确认跨供应商转换,
消除 Phase 1 信号(如 zhipu 自身 srvtoolu_* ID)在纯单供应商会话中误触
发通道导致不必要的请求体变换。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
注册表键从 target_vendor 改为 (source, target) 二元组,通道函数从
prepare_for_X 重命名为 prepare_X_to_Y,触发逻辑从 _needs_vendor_channel
替换为 _determine_source_vendor(基于请求内 failed_tier_name 和会话历史
推断源 vendor),未注册的转换对不触发任何通道;

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
- 架构图 Tier 排序与默认配置 tiers 对齐:Zhipu(T0) → Anthropic(T1) → Copilot(T2) → Antigravity(T3)
- CLI 指南表补全 auth 子命令组(login/status/reauth/logout)
- 格式转换描述补全 Anthropic ↔ OpenAI 双向支持
- 供应商列表显式补全 Google Antigravity

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
docs(readme): 校准架构图 Tier 排序、补全 CLI auth 子命令与格式转换描述
refactor(vendor-channels): 供应商转换通道从目标专属重构为源→目标绑定模型
…dor_channels 统一维护;

移除 request_normalizer.py 中已废弃的 Phase 2 逻辑(apply_anthropic_specific_fixes、_repair_orphaned_tool_use 等),
将 enforce_anthropic_tool_pairing 和 strip_thinking_blocks 移入 vendor_channels.py,
合并重复的 _strip_thinking_blocks_inplace 为统一的 strip_thinking_blocks 公开函数,
移除 normalization 参数在 routes→router→executor 三层透传中的死参数链,
精简 NormalizationResult 仅保留 Phase 1 必要字段。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
refactor(vendor-channels): 将 vendor 转换专属函数从 request_normalizer 迁入 vendor_channels 统一维护
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
@ThreeFish-AI ThreeFish-AI changed the title Feature/1.x.x v0.2.4 Apr 18, 2026
@ThreeFish-AI
ThreeFish-AI merged commit ee1ae06 into master Apr 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant