fix: 创建 agent 后刷新 loadMarkdownFilesForSubdir 缓存

新建 agent 后 clearAgentDefinitionsCache 漏清底层
loadMarkdownFilesForSubdir 的 memoize 缓存,导致新
agent 不会立即出现在列表中,需要重启才能生效。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-24 15:04:02 +08:00
parent eadd32ae47
commit eb833da33b
2 changed files with 4 additions and 0 deletions

View File

@@ -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!,