Repository navigation
fix(protocol): 保留路径删除无可用签名的 thinking,协议页默认可返回摘要 #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,13 @@ import { | |
| modelSupportsMidConversationSystem, | ||
| } from './anthropic-policy.mjs' | ||
| import { liftMidConversationSystemMessages } from './sanitize.mjs' | ||
| import { ensureUnofficialAdaptiveThinking, ensureUnofficialEffortHigh, normalizeThinkingForModel } from './thinking.mjs' | ||
| import { | ||
| applyThinkingDisplay, | ||
| ensureUnofficialAdaptiveThinking, | ||
| ensureUnofficialEffortHigh, | ||
| normalizeThinkingForModel, | ||
| thinkingDisplayMode, | ||
| } from './thinking.mjs' | ||
| import { ensureOutputConfigSchema } from './request-rectifier.mjs' | ||
| import { | ||
| applyCrsIdentityReplace, | ||
|
|
@@ -334,6 +340,7 @@ export function prepareOutboundHeaders(reqHeaders, homeDir, identity, model, { c | |
|
|
||
| /** Body + headers after the context_management ↔ context-management beta gate. */ | ||
| export function prepareOutboundEnvelope({ | ||
| requestContext = null, | ||
| canonicalBody, | ||
| inbound = {}, | ||
| identity, | ||
|
|
@@ -368,6 +375,7 @@ export function prepareOutboundEnvelope({ | |
| want1m, | ||
| } = {}) { | ||
| const prepared = prepareOutboundAttempt({ | ||
| requestContext, | ||
| canonicalBody, | ||
| inbound, | ||
| identity, | ||
|
|
@@ -421,11 +429,15 @@ export function prepareOutboundEnvelope({ | |
| const beta = ensureFastModeBeta(headers['anthropic-beta'] || '', prepared.body) | ||
| if (beta) headers['anthropic-beta'] = beta | ||
| } | ||
| const displayed = | ||
| requestContext?.purpose === 'auto_mode_classifier' | ||
| ? prepared.body | ||
| : applyThinkingDisplay(prepared.body, thinkingDisplayMode(routing)) | ||
| headers['anthropic-beta'] = withRequestProtocolBetas( | ||
| String(headers['anthropic-beta'] || '').split(','), | ||
| prepared.body, | ||
| displayed, | ||
| ).join(',') | ||
| const body = sealClaudeCodeCch(sanitizeAnthropicBodyForBetaTokens(prepared.body, headers?.['anthropic-beta'] || ''), { | ||
| const body = sealClaudeCodeCch(sanitizeAnthropicBodyForBetaTokens(displayed, headers?.['anthropic-beta'] || ''), { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HTTP hop ignores passthrough settingHigh Severity Default HTTP hop never passes Reviewed by Cursor Bugbot for commit c452238. Configure here. |
||
| enabled: routing?.compatibility?.cch_enabled !== false, | ||
| }) | ||
| return { body, headers, toolNames: prepared.toolNames } | ||
|
|
||


There was a problem hiding this comment.
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.prepareOutboundAttemptandprepareCliHopBodystop atprepareClassifierBody, but the HTTP envelope and worker finalize always rewrite hidden or unset display tosummarizedafterward. 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)
src/lib/transport/go-worker-client.mjs#L439-L445Reviewed by Cursor Bugbot for commit c452238. Configure here.