mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
fix: 创建 agent 后刷新 loadMarkdownFilesForSubdir 缓存
新建 agent 后 clearAgentDefinitionsCache 漏清底层 loadMarkdownFilesForSubdir 的 memoize 缓存,导致新 agent 不会立即出现在列表中,需要重启才能生效。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -394,6 +394,7 @@ export const getAgentDefinitionsWithOverrides = memoize(
|
||||
|
||||
export function clearAgentDefinitionsCache(): void {
|
||||
getAgentDefinitionsWithOverrides.cache.clear?.()
|
||||
loadMarkdownFilesForSubdir.cache?.clear?.()
|
||||
clearPluginAgentCache()
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useSetAppState } from 'src/state/AppState.js'
|
||||
import type { Tools } from '../../../../Tool.js'
|
||||
import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
|
||||
import { getActiveAgentsFromList } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
|
||||
import { clearAgentDefinitionsCache } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'
|
||||
import { editFileInEditor } from '../../../../utils/promptEditor.js'
|
||||
import { useWizard } from '../../../wizard/index.js'
|
||||
import { getNewAgentFilePath, saveAgentToFile } from '../../agentFileUtils.js'
|
||||
@@ -62,6 +63,8 @@ export function ConfirmStepWrapper({
|
||||
}
|
||||
})
|
||||
|
||||
clearAgentDefinitionsCache()
|
||||
|
||||
if (openInEditor) {
|
||||
const filePath = getNewAgentFilePath({
|
||||
source: wizardData.location!,
|
||||
|
||||
Reference in New Issue
Block a user