Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: initialize agent cache before delete lookup

Adam Eivyc97c08568eef
diff --git a/server/services/cos.js b/server/services/cos.js
index bbcd023b25..5bb05b4a0c 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -2614,9 +2614,10 @@ export async function deleteAgent(agentId) {
return withStateLock(async () => {
const state = await loadState();
- // Check both state and cache
+ // Check state, cache, and disk (ensure cache is initialized)
const inState = !!state.agents[agentId];
- const inCache = completedAgentCache?.has(agentId);
+ const cache = await loadCompletedAgentCache();
+ const inCache = cache.has(agentId);
if (!inState && !inCache) {
return { error: 'Agent not found' };
}