Agent管理页面手动触发预检时,先删缓存再预检

This commit is contained in:
xintaofei
2026-03-17 22:56:42 +08:00
parent ef3978a4fa
commit ff54505b6c
4 changed files with 28 additions and 11 deletions

View File

@@ -2388,11 +2388,12 @@ export function AcpAgentSettings() {
}
}, [])
const runPreflight = useCallback(async (agentType: AgentType) => {
const runPreflight = useCallback(
async (agentType: AgentType, forceRefresh?: boolean) => {
setChecking((prev) => ({ ...prev, [agentType]: true }))
try {
const [resultState, versionState] = await Promise.allSettled([
acpPreflight(agentType),
acpPreflight(agentType, forceRefresh),
acpDetectAgentLocalVersion(agentType),
])
@@ -4243,12 +4244,14 @@ export function AcpAgentSettings() {
})}
onClick={(event) => {
event.stopPropagation()
runPreflight(agent.agent_type).catch((err) => {
console.error(
"[Settings] single preflight failed:",
err
)
})
runPreflight(agent.agent_type, true).catch(
(err) => {
console.error(
"[Settings] single preflight failed:",
err
)
}
)
}}
>
<RefreshCw className="h-3 w-3 shrink-0" />

View File

@@ -210,9 +210,13 @@ export async function acpReorderAgents(agentTypes: AgentType[]): Promise<void> {
}
export async function acpPreflight(
agentType: AgentType
agentType: AgentType,
forceRefresh?: boolean
): Promise<PreflightResult> {
return invoke("acp_preflight", { agentType })
return invoke("acp_preflight", {
agentType,
forceRefresh: forceRefresh ?? null,
})
}
export async function acpListAgentSkills(params: {