mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
fix: 尝试修复多轮对话缓存失效 skill 提升的问题
This commit is contained in:
@@ -819,6 +819,10 @@ export async function getAttachments(
|
||||
!options?.skipSkillDiscovery
|
||||
? [
|
||||
maybe('skill_discovery', async () => {
|
||||
if (suppressNextDiscovery) {
|
||||
suppressNextDiscovery = false
|
||||
return []
|
||||
}
|
||||
const result = await skillSearchModules.prefetch.getTurnZeroSkillDiscovery(
|
||||
input,
|
||||
messages ?? [],
|
||||
@@ -2638,6 +2642,7 @@ const sentSkillNames = new Map<string, Set<string>>()
|
||||
export function resetSentSkillNames(): void {
|
||||
sentSkillNames.clear()
|
||||
suppressNext = false
|
||||
suppressNextDiscovery = false
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2661,6 +2666,18 @@ export function suppressNextSkillListing(): void {
|
||||
}
|
||||
let suppressNext = false
|
||||
|
||||
/**
|
||||
* Suppress the next skill-discovery injection on resume. Same rationale as
|
||||
* suppressNextSkillListing: skill_discovery attachments are not persisted to
|
||||
* transcript for non-ant users, so the prior process's discovery result is
|
||||
* already in the conversation history the model sees. Re-generating it would
|
||||
* inject duplicate content and bust the prompt cache prefix.
|
||||
*/
|
||||
export function suppressNextSkillDiscovery(): void {
|
||||
suppressNextDiscovery = true
|
||||
}
|
||||
let suppressNextDiscovery = false
|
||||
|
||||
// When skill-search is enabled and the filtered (bundled + MCP) listing exceeds
|
||||
// this count, fall back to bundled-only. Protects MCP-heavy users (100+ servers)
|
||||
// from truncation while keeping the turn-0 guarantee for typical setups.
|
||||
|
||||
Reference in New Issue
Block a user