Skip to content

fix(protocol): 保留路径删除无可用签名的 thinking,协议页默认可返回摘要 - #592

Merged
dofastted merged 3 commits into
mainfrom
fix/thinking-display-summarized
Oct 19, 2026
Merged

dofastted merged 3 commits into
mainfrom
fix/thinking-display-summarized

Conversation

@dofastted

@dofastted dofastted commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

改动

  • 保留路径(cli-hop 首跳、默认 HTTP hop)不再给没有 signature 字段的 thinking 补 signature: ""。缺失、空、短于 24、dummy 的删掉;签名可用的留,空正文也留。redacted_thinking 在这一支里不看 data 和签名,原样留。
  • 5.5 的非保留路径不变:短的非 dummy 签名仍留。更早型号仍按不少于 24 逐块过滤。没有按账号归属过滤签名。
  • 协议页新增「thinking 显示」。routing.compatibility.thinking_display 默认 summarized:调用方打开 thinking 却要求隐藏(omitted、updates,或默认隐藏的模型上没写 display)时,出站在计算 beta 之前改成 summarized。显式 passthrough 保留调用方的值。已保存的 routing.json 不写这个键也按 summarized 生效。

验证

  • node --test 覆盖 anthropic-policy、cli-hop-body、go-worker-client、fast-mode、persona-template、quota-tiers:175 passed。
  • test/e2e/auto-mode.e2e.test.mjs 的真实 kernel + CLI 出站:缺字段的 thinking 被删,24 字符的空正文块留下。
  • pnpm -C web exec tsc --noEmit -p tsconfig.json 通过。

只更新 Node 控制面和 web/dist,重启一次。无迁移,不必 wrap-cli/sync,不必重建槽。不要覆盖 routing.json、vms/、data/、.env。


Note

Medium Risk
Changes outbound Anthropic request bodies (thinking history filtering and thinking.display), which can alter upstream acceptance and what clients see; scope is protocol compatibility rather than auth or billing.

Overview
Preserve-path thinking on cli-hop and default HTTP hop no longer pads missing thinking signatures with signature: "". Blocks without a usable signature (missing, empty, shorter than 24 chars, or dummy) are dropped; valid signatures stay, including empty thinking text. redacted_thinking is kept unchanged on this path. Non-preserve paths and 5.5 chain rules are unchanged except as documented.

Thinking display adds routing.compatibility.thinking_display (default summarized). For active adaptive / enabled thinking, outbound rewrites hidden displays (omitted, updates, or unset on models that default-hide) to summarized before beta headers—so updates no longer pulls thinking-display-updates-2026-08-18 when summarized. passthrough leaves the caller’s display. Wired through HTTP outbound and Go worker finalize; the protocol settings UI exposes a toggle; panel routing validation and defaults treat missing config as summarized.

Reviewed by Cursor Bugbot for commit c452238. Configure here.

cli-hop 首跳和默认 HTTP hop 不再给缺签名的 thinking 补空字段:缺失、空、短于 24、dummy 的删掉,签名可用的留。5.5 的非保留路径仍接受短的非 dummy 签名。协议页新增 thinking 显示,默认 summarized,显式 passthrough 才保留调用方的 display。

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c452238. Configure here.

displayed,
).join(',')
const body = sealClaudeCodeCch(sanitizeAnthropicBodyForBetaTokens(prepared.body, headers?.['anthropic-beta'] || ''), {
const body = sealClaudeCodeCch(sanitizeAnthropicBodyForBetaTokens(displayed, headers?.['anthropic-beta'] || ''), {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

HTTP hop ignores passthrough setting

High Severity

Default HTTP hop never passes routing into prepareOutboundEnvelope, so thinkingDisplayMode always falls back to summarized. The protocol-page passthrough switch therefore cannot keep caller omitted/updates on that path. A later worker pass cannot restore the original display once the body is already rewritten.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c452238. Configure here.

headers['anthropic-beta'] = withRequestProtocolBetas(
String(headers['anthropic-beta'] || '').split(','),
prepared.body,
displayed,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Classifier hops still rewrite thinking display

High Severity

Classifier requests still run through applyThinkingDisplay. prepareOutboundAttempt and prepareCliHopBody stop at prepareClassifierBody, but the HTTP envelope and worker finalize always rewrite hidden or unset display to summarized afterward. Auto-mode classifiers on models that hide thinking by default can then emit summaries instead of the expected tool or XML verdict.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c452238. Configure here.

cursoragent and others added 2 commits October 19, 2026 07:27
Wire requestContext through prepareOutboundEnvelope, bypass applyThinkingDisplay
for auto_mode_classifier in envelope and worker finalize, pass routing into HTTP
hop prepareOutboundEnvelope, and add unit coverage. Run biome/prettier on CI files.

Co-authored-by: ted <kuhlmangarry24@gmail.com>
Keep unofficial envelope snapshot aligned with official omitted display without
asserting against the gateway default summarized rewrite.

Co-authored-by: ted <kuhlmangarry24@gmail.com>
@dofastted
dofastted merged commit 2082aef into main Oct 19, 2026
7 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.

2 participants