Repository navigation
fix(protocol): 保留路径删除无可用签名的 thinking,协议页默认可返回摘要 - #592
Conversation
cli-hop 首跳和默认 HTTP hop 不再给缺签名的 thinking 补空字段:缺失、空、短于 24、dummy 的删掉,签名可用的留。5.5 的非保留路径仍接受短的非 dummy 签名。协议页新增 thinking 显示,默认 summarized,显式 passthrough 才保留调用方的 display。
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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'] || ''), { |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit c452238. Configure here.
| headers['anthropic-beta'] = withRequestProtocolBetas( | ||
| String(headers['anthropic-beta'] || '').split(','), | ||
| prepared.body, | ||
| displayed, |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit c452238. Configure here.
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>


改动
signature字段的 thinking 补signature: ""。缺失、空、短于 24、dummy 的删掉;签名可用的留,空正文也留。redacted_thinking在这一支里不看 data 和签名,原样留。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
thinkingsignatures withsignature: "". Blocks without a usable signature (missing, empty, shorter than 24 chars, or dummy) are dropped; valid signatures stay, including empty thinking text.redacted_thinkingis 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(defaultsummarized). For activeadaptive/enabledthinking, outbound rewrites hidden displays (omitted,updates, or unset on models that default-hide) tosummarizedbefore beta headers—soupdatesno longer pullsthinking-display-updates-2026-08-18when summarized.passthroughleaves 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.