Skip to content

fix(provider): 支持 Claude Opus 5.5 自适应思考协议 - #1131

Closed
zszz3 wants to merge 25 commits into
vastsa:mainfrom
zszz3:fix/adaptive-thinking-1126
Closed

zszz3 wants to merge 25 commits into
vastsa:mainfrom
zszz3:fix/adaptive-thinking-1126

Conversation

@zszz3

@zszz3 zszz3 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

变更说明

Claude Opus 5.5 不接受旧版 thinking 请求格式。本 PR 增加 legacy / adaptive thinking protocol 元数据,并在模型高级设置中提供可见的协议选择。

  • adaptive 模型发送 thinking.type=adaptive 和 output_config.effort。
  • legacy 模型保持原有 budget_tokens 请求格式。
  • models.dev 中带有 reasoning_options.effort 的 Anthropic 模型自动识别为 adaptive。
  • 缺少新字段的旧配置继续按 legacy 行为工作。
  • 增加 TypeScript、UI 契约、models.dev catalog、Rust host-core 测试和规格说明。

验证

  • pnpm build:js 通过
  • @pi-desktop/desktop typecheck 通过
  • provider-binding.test.ts:25/25 通过
  • models.dev / UI 相关 Node 测试:34/34 通过
  • cargo fmt --check 通过
  • cargo test -p host-core --locked:410/410 通过
  • cargo clippy -p host-core --all-targets --locked 通过
  • 完整 agent-runtime 测试中已有的两个 retry 超时测试失败,其他 452 项通过;与本次改动无关。
  • 控制 Electron E2E 未运行,仓库规则要求用户在当前任务显式授权 verify:ui:*。

Closes #1126

zszz3 and others added 25 commits September 12, 2026 21:19
Keep Enter as a queued follow-up and route Alt+Enter to the active turn through native steering. Preserve accepted input and streaming reply order across Stop and recovery, and show platform-specific shortcut labels.
# Conflicts:
#	apps/desktop/src/lib/api.ts
#	crates/host-core/src/main.rs
#	crates/host-core/src/rpc/mod.rs
#	docs/adr/README.md
#	docs/adr/session-content-search.md
#	docs/spec/06-delivery/04-e2e-test-plan.md
#	docs/spec/08-meta/decisions-log.md
#	docs/zh-CN/spec/08-meta/decisions-log.md
#	packages/shared/src/index.ts
# Conflicts:
#	docs/spec/08-meta/decisions-log.md
#	docs/zh-CN/spec/08-meta/decisions-log.md
# Conflicts:
#	docs/spec/06-delivery/04-e2e-test-plan.md
#	docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
#	docs/zh-CN/spec/08-meta/decisions-log.md
# Conflicts:
#	docs/spec/06-delivery/04-e2e-test-plan.md
#	docs/spec/08-meta/decisions-log.md
Every non-empty group still keeps its own three-row share, but the share
smaller groups leave unused now goes to the groups that still overflow, in
Running -> Unread -> Pinned order, up to nine rows in total. Seven running
sessions with no unread or pinned show all seven instead of three. Overflow
is measured against the share a group actually received, so View more no
longer appears when every session is already listed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The desktop augmentation of the shared error-code union, and the
isHostUnavailable classifier that reads it, were copied verbatim into both
index.ts and runtime/session-launch.ts. Moving them beside describeError in
error-codes.ts leaves one copy and keeps index.ts under its LOC budget.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The English scenario index gained two ordered-model-fallback rows without
the Chinese mirror, so check:locales rejected the pair's table shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add explicit legacy and adaptive thinking metadata so Claude Opus 5.5 uses
Anthropic's adaptive request shape while existing bindings keep legacy behavior.

Closes vastsa#1126

@vastsa vastsa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要修改后再考虑合并。

  1. 当前 head df1b4abc 与最新 main 已冲突,且 #1127 刚刚合入后基线再次前进;必须先在自己的分支同步最新 main 并解决冲突。
  2. 该 PR 不是可独立落地的 fix:标题是 feat(provider),但差异包含搜索、托盘、侧边栏、模型能力等多条无关历史提交,共 61 个文件、1377 行新增/154 行删除。请拆出 Claude adaptive thinking 的最小变更集,避免把其他功能和冲突解析一起合入。
  3. 当前 required JS/Rust/base checks 没有通过记录,Vercel 也失败;拆分并刷新基线后需重新运行完整 required checks。

在上述问题解决前不能合入。

@vastsa vastsa closed this Sep 27, 2026
@vastsa vastsa reopened this Sep 27, 2026
@vastsa

vastsa commented Sep 27, 2026

Copy link
Copy Markdown
Owner

您好,辛苦解决一下冲突后,我们这边合并哦

@vastsa vastsa changed the title feat(provider): 支持 Claude Opus 5.5 自适应思考协议 fix(provider): 支持 Claude Opus 5.5 自适应思考协议 Sep 27, 2026
@zszz3 zszz3 closed this Sep 27, 2026
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.

feat(provider): 支持 Claude Opus 5.5 的自适应思考协议

2 participants