fix(utility-model): 直连 Anthropic Messages 用真实 API model id,剥离 SDK [1m] 后缀 - #2469
Open
gardenZzz wants to merge 1 commit into
Open
fix(utility-model): 直连 Anthropic Messages 用真实 API model id,剥离 SDK [1m] 后缀#2469gardenZzz wants to merge 1 commit into
gardenZzz wants to merge 1 commit into
Conversation
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/utility-model/oneShotCandidates.ts | 内置 Anthropic 直连分支改用 provider-native 模型 ID,避免将 SDK [1m] 后缀发送到 Messages API。 |
| apps/desktop/src/main/utility-model/tests/oneShotCandidates.test.ts | 更新并扩充 Anthropic 请求体断言,覆盖 1M 上下文模型和普通 Claude 模型。 |
Reviews (2): Last reviewed commit: "fix(utility-model): 直连 Anthropic Message..." | Re-trigger Greptile
Author
|
@MagicLizi 已按 PR 模板补全描述(「这次改了什么」含摘要/变更类型/范围/UI 变化,「怎么验证的」含 typecheck + 定向测试 + fork CI 链接,「风险」完整)。请重新审查,谢谢。 fork client-ci 等价验证(同 SHA |
This was referenced Aug 12, 2026
…] 后缀 (makecindy#2429) Auto-review / 任务摘要等 utility one-shot 路径在内置 anthropic 分支直连 /v1/messages 时,把 Claude Code SDK 的 wire 字符串(如 claude-fable-5[1m]) 原样发进请求体。`[1m]` 是 maker-core toSdkModelString 为 SDK 识别 1M beta 通道追加的内部后缀(SDK 细节不外泄给调用方),Anthropic API 不认它, 对 1M 上下文模型(fable/opus/sonnet)恒返回 404 → reviewer 拿不到结果 → Auto 模式 fail-closed 成 `[AUTO_REVIEW_UNAVAILABLE]`。 修复:在 anthropic 分支把目录 model id 经新的 toAnthropicMessagesModelId 转换后发出——复用 toSdkModelString 的窗口口径但剥掉 `[1m]` 后缀,得到 provider-native 的 API model id。转换只作用于内置 anthropic 的 Messages 直连路径;自定义/兼容供应商保持各自 model 透传,不做全局剥离。 验证:desktop typecheck 通过;oneShotCandidates 定向测试 46 条全绿 (含新增:1M 模型 claude-fable-5/claude-opus-5 直连 body 不含 `[1m]`, 非 1M Haiku 不回归);全量 test:unit 交 CI(fork client-ci 同 SHA 验证)。 Closes makecindy#2429 Signed-off-by: GardenX <20606485+gardenZzz@users.noreply.github.com>
Author
状态更新格式门(MagicLizi CHANGES_REQUESTED)PR body 已按模板补全:
请重新扫描格式门,谢谢。 CI Linux unit tests (1/2) 失败定位真实失败(非 warn 噪音): 与本 PR 无关:本 PR 只改
同 SHA 的 fork client-ci 8/8 全绿:https://github.com/gardenZzz/cindy/actions/runs/31506118835 已 rebase 到最新 |
gardenZzz
force-pushed
the
fix/utility-anthropic-messages-model-id-clean
branch
from
August 12, 2026 05:45
15c9de2 to
afea46f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这次改了什么
摘要
修复 #2429:Auto-review / 任务摘要等 utility one-shot 路径在内置 anthropic 分支直连
/v1/messages时,把 Claude Code SDK 的 wire 字符串(如claude-fable-5[1m])原样发进请求体。[1m]是 maker-coretoSdkModelString为 SDK 识别 1M beta 通道追加的内部后缀(契约明确「SDK 细节不外泄给调用方」)。Anthropic Messages API 不认它,对 1M 上下文模型(fable/opus/sonnet)恒返回 404 → reviewer 拿不到结果 → Auto 模式 fail-closed 成[AUTO_REVIEW_UNAVAILABLE]。主对话链正常是因为它走 Claude Code SDK + 本地代理,SDK 内部翻译了[1m]。变更类型
fix缺陷修复范围
toAnthropicMessagesModelId()(复用toSdkModelString的窗口口径,剥离[1m]后缀,产出 provider-native API model id);内置 anthropic 分支改用该转换。[AUTO_REVIEW_UNAVAILABLE]。UI 变化
不涉及:本改动只调整 utility 请求体 model 字段,无视觉、布局、动效或文案变化。
怎么验证的
自动验证
全量
test:unit由 fork client-ci(同 SHA15c9de259)验证:https://github.com/gardenZzz/cindy/actions/runs/31506118835 (8/8 job success)。手工验证
不涉及(主仓 CI 需维护者放行,fork CI 等价验证已全绿)。
未执行的验证
无。
风险
风险分类
影响与回滚
Closes #2429