From bf57c9b11f8a368d6de158b25981dd36b4c6fc3c Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Sat, 20 Jun 2026 11:37:31 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=20cachedMCConfig=20?= =?UTF-8?q?stub=20=E5=8F=8A=20prompts.ts=20=E7=9A=84=20CACHED=5FMICROCOMPA?= =?UTF-8?q?CT=20=E6=AD=BB=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 src/services/compact/cachedMCConfig.ts(自动生成的 stub) - 同步移除 src/constants/prompts.ts 中依赖该 stub 的代码: - getCachedMCConfigForFRC 变量(feature('CACHED_MICROCOMPACT') 守卫的 require) - getFunctionResultClearingSection 函数(约 18 行) - systemPrompt 数组中的 frc section 调用与注册 CACHED_MICROCOMPACT 不在 build.ts DEFAULT_BUILD_FEATURES 也不在 dev 默认列表,所有默认配置下整段为构建期死代码。 Co-Authored-By: glm-5.2 --- src/constants/prompts.ts | 28 -------------------------- src/services/compact/cachedMCConfig.ts | 8 -------- 2 files changed, 36 deletions(-) delete mode 100644 src/services/compact/cachedMCConfig.ts diff --git a/src/constants/prompts.ts b/src/constants/prompts.ts index 66390a046..49755d8a7 100644 --- a/src/constants/prompts.ts +++ b/src/constants/prompts.ts @@ -67,12 +67,6 @@ import { getCurrentMode } from 'src/modes/store.js' // Dead code elimination: conditional imports for feature-gated modules /* eslint-disable @typescript-eslint/no-require-imports */ -const getCachedMCConfigForFRC = feature('CACHED_MICROCOMPACT') - ? ( - require('../services/compact/cachedMCConfig.js') as typeof import('../services/compact/cachedMCConfig.js') - ).getCachedMCConfig - : null - const proactiveModule = feature('PROACTIVE') || feature('KAIROS') ? require('../proactive/index.js') @@ -454,7 +448,6 @@ ${CYBER_RISK_INSTRUCTION}`, ? null : getMcpInstructionsSection(mcpClients), getScratchpadInstructions(), - getFunctionResultClearingSection(model), SUMMARIZE_TOOL_RESULTS_SECTION, getProactiveSection(), ].filter(s => s !== null) @@ -492,7 +485,6 @@ ${CYBER_RISK_INSTRUCTION}`, 'MCP servers connect/disconnect between turns', ), systemPromptSection('scratchpad', () => getScratchpadInstructions()), - systemPromptSection('frc', () => getFunctionResultClearingSection(model)), systemPromptSection( 'summarize_tool_results', () => SUMMARIZE_TOOL_RESULTS_SECTION, @@ -781,26 +773,6 @@ Only use \`/tmp\` if the user explicitly requests it. The scratchpad directory is session-specific, isolated from the user's project, and can be used freely without permission prompts.` } -function getFunctionResultClearingSection(model: string): string | null { - if (!feature('CACHED_MICROCOMPACT') || !getCachedMCConfigForFRC) { - return null - } - const config = getCachedMCConfigForFRC() - const isModelSupported = config.supportedModels?.some(pattern => - model.includes(pattern), - ) - if ( - !config.enabled || - !config.systemPromptSuggestSummaries || - !isModelSupported - ) { - return null - } - return `# Function Result Clearing - -Old tool results will be automatically cleared from context to free up space. The ${config.keepRecent} most recent results are always kept.` -} - const SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.` function getBriefSection(): string | null { diff --git a/src/services/compact/cachedMCConfig.ts b/src/services/compact/cachedMCConfig.ts deleted file mode 100644 index 3279fcc07..000000000 --- a/src/services/compact/cachedMCConfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {} -export const getCachedMCConfig: () => { - enabled?: boolean - systemPromptSuggestSummaries?: boolean - supportedModels?: string[] - [key: string]: unknown -} = () => ({})