Skip to content

fix(protocol): native cli-hop 不再提前改模型策略和采样字段 - #729

Closed
dofastted wants to merge 2 commits into
mainfrom
fix/native-field-boundary
Closed

dofastted wants to merge 2 commits into
mainfrom
fix/native-field-boundary

Conversation

@dofastted

@dofastted dofastted commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • prepareCliHopBody 不再改 thinking 类型、tool_choice、effort,也不再删除调用方显式的 temperature、top_p、top_k、context_management。
  • thinking_display=summarized 仍由 Node 应用。
  • 删除写死为 false 的 panelRewrite 分支。
  • 旧 Haiku、Opus / Sonnet 5.5 策略和缺失 effort=medium 由 cli-node native 路径负责。该源码在本地 local-src,依赖尚未推送的 cli-node 历史,未包含在这个 PR。当前线上 ELF 也未重编。

Test plan

  • node --test test/unit/cli-hop-body.test.mjs test/unit/cache-ttl.test.mjs:42 pass
  • 合并前仍需 live verify-live.py。本 PR 未部署、未合并。

Note

Medium Risk
Shifts thinking, effort, and model normalization from Node to cli-node; behavior depends on matching cli-node changes and live verification before merge.

Overview
Native cli-hop stops reshaping requests in Node before they reach cli-node. prepareCliHopBody no longer applies model policy (applyModelRequestRules), Haiku thinking pins, unofficial high effort, or strips caller temperature / top_p / top_k / context_management. It still applies thinking display (summarized), invalid-thinking cleanup, official system/message cache markers, and related sanitization.

The cli-hop path in handle-protocol drops the dead panelRewrite branch (always false) that would have run unofficial persona rewrites and cache validation on the hop body; personaHideTokens is always 0 for cli-hop.

Unit tests now expect model strings, thinking modes, tool choice, and sampling fields to pass through unchanged—Haiku/Opus 5.5 policy and default effort are documented as moving to cli-node (not in this PR).

Reviewed by Cursor Bugbot for commit 5e13ab2. Configure here.

thinking、tool_choice、effort 与显式采样字段交给 cli-node。面板 thinking display 仍由 Node 应用,并删除写死的 panelRewrite 分支。
@cursor

cursor Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: a0711bfc-1686-457d-9ec4-c4a2793b2ce8)

@dofastted
dofastted marked this pull request as draft October 25, 2026 21:10
@dofastted

Copy link
Copy Markdown
Owner Author

合并门禁

这个 PR 只删除 Node 侧的模型策略,不是完整迁移。

当前线上 cli-node 还没有 applyNativeModelPolicy。按原实现顺序,cli-node native 测试转绿并且新 ELF 部署之前,不能合并。否则旧 Haiku 的 thinking disabled、Opus / Sonnet 5.5 的 thinking 与 forced tool choice 会直接到达上游。

配套 CLI 提交目前在本地 local-src:

  • 5203e416 native 路径接管旧模型策略和 medium effort
  • 0d6cdde1 classifier 和调用方省略字段不改
  • c9ec471a 生成请求仍把 forced tool 改成 auto
  • 7de9a227 Haiku 5.5 在 xhigh / max 时不保留 disabled thinking

这些提交依赖 claude-code 上尚未推送的历史,不能单独落到其 main。需要先以对应远程功能分支为 base 开 stacked PR,或在独立 worktree 里移植这三个文件并验证后,才能合并本 PR。

未重编 ELF,未部署。

- CHANGELOG 未发布补充 #729 cli-hop 策略下沉 cli-node 说明
- sonnet-55-policy:区分 prepareCliHopBody 透传与 prepareAnthropicRequest 策略
- mid-convo-effort:Haiku hop 不再剥离 effort,仅保留 Sonnet 5 提升行为

Co-authored-by: ted <kuhlmangarry24@gmail.com>
@dofastted

Copy link
Copy Markdown
Owner Author

关闭:核心提交(native cli-hop 不再提前改模型策略和采样字段)已随 #730 合入 main,不再单独合并。注意本 PR 描述里的门禁:cli-node native 路径接管旧模型策略需随新 ELF 部署,这一点与是否合并本 PR 无关,仍需跟进。

@dofastted dofastted closed this Oct 26, 2026
@dofastted dofastted mentioned this pull request Oct 26, 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.

2 participants