mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 05:45:51 +00:00
feat: 移除反蒸馏代码
This commit is contained in:
@@ -20,9 +20,6 @@ export const FAST_MODE_BETA_HEADER = 'fast-mode-2026-02-01'
|
||||
export const REDACT_THINKING_BETA_HEADER = 'redact-thinking-2026-02-12'
|
||||
export const TOKEN_EFFICIENT_TOOLS_BETA_HEADER =
|
||||
'token-efficient-tools-2026-03-28'
|
||||
export const SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER = feature('CONNECTOR_TEXT')
|
||||
? 'summarize-connector-text-2026-03-13'
|
||||
: ''
|
||||
export const AFK_MODE_BETA_HEADER = feature('TRANSCRIPT_CLASSIFIER')
|
||||
? 'afk-mode-2026-01-31'
|
||||
: ''
|
||||
|
||||
@@ -299,20 +299,6 @@ export function getExtraBodyParams(betaHeaders?: string[]): JsonObject {
|
||||
}
|
||||
}
|
||||
|
||||
// Anti-distillation: send fake_tools opt-in for 1P CLI only
|
||||
if (
|
||||
feature('ANTI_DISTILLATION_CC')
|
||||
? process.env.CLAUDE_CODE_ENTRYPOINT === 'cli' &&
|
||||
shouldIncludeFirstPartyOnlyBetas() &&
|
||||
getFeatureValue_CACHED_MAY_BE_STALE(
|
||||
'tengu_anti_distill_fake_tool_injection',
|
||||
false,
|
||||
)
|
||||
: false
|
||||
) {
|
||||
result.anti_distillation = ['fake_tools']
|
||||
}
|
||||
|
||||
// Handle beta headers if provided
|
||||
if (betaHeaders && betaHeaders.length > 0) {
|
||||
if (result.anthropic_beta && Array.isArray(result.anthropic_beta)) {
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
PROMPT_CACHING_SCOPE_BETA_HEADER,
|
||||
REDACT_THINKING_BETA_HEADER,
|
||||
STRUCTURED_OUTPUTS_BETA_HEADER,
|
||||
SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER,
|
||||
TOKEN_EFFICIENT_TOOLS_BETA_HEADER,
|
||||
TOOL_SEARCH_BETA_HEADER_1P,
|
||||
TOOL_SEARCH_BETA_HEADER_3P,
|
||||
@@ -276,27 +275,6 @@ export const getAllModelBetas = memoize((model: string): string[] => {
|
||||
betaHeaders.push(REDACT_THINKING_BETA_HEADER)
|
||||
}
|
||||
|
||||
// POC: server-side connector-text summarization (anti-distillation). The
|
||||
// API buffers assistant text between tool calls, summarizes it, and returns
|
||||
// the summary with a signature so the original can be restored on subsequent
|
||||
// turns — same mechanism as thinking blocks. Ant-only while we measure
|
||||
// TTFT/TTLT/capacity; betas already flow to tengu_api_success for splitting.
|
||||
// Backend independently requires Capability.ANTHROPIC_INTERNAL_RESEARCH.
|
||||
//
|
||||
// USE_CONNECTOR_TEXT_SUMMARIZATION is tri-state: =1 forces on (opt-in even
|
||||
// if GB is off), =0 forces off (opt-out of a GB rollout you were bucketed
|
||||
// into), unset defers to GB.
|
||||
if (
|
||||
SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER &&
|
||||
process.env.USER_TYPE === 'ant' &&
|
||||
includeFirstPartyOnlyBetas &&
|
||||
!isEnvDefinedFalsy(process.env.USE_CONNECTOR_TEXT_SUMMARIZATION) &&
|
||||
(isEnvTruthy(process.env.USE_CONNECTOR_TEXT_SUMMARIZATION) ||
|
||||
getFeatureValue_CACHED_MAY_BE_STALE('tengu_slate_prism', false))
|
||||
) {
|
||||
betaHeaders.push(SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER)
|
||||
}
|
||||
|
||||
// Add context management beta for tool clearing (ant opt-in) or thinking preservation
|
||||
const antOptedIntoToolClearing =
|
||||
isEnvTruthy(process.env.USE_API_CONTEXT_MANAGEMENT) &&
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Transforms SDK messages for streamlined output mode.
|
||||
*
|
||||
* Streamlined mode is a "distillation-resistant" output format that:
|
||||
* Streamlined mode is a compact output format that:
|
||||
* - Keeps text messages intact
|
||||
* - Summarizes tool calls with cumulative counts (resets when text appears)
|
||||
* - Omits thinking content
|
||||
|
||||
Reference in New Issue
Block a user