chore: reset agents.json and add mode change handling to agent manager

This commit is contained in:
Mohamed Boudra
2025-10-26 07:41:27 +01:00
parent a3224175ee
commit 0cc9666df0
2 changed files with 12 additions and 50 deletions
@@ -1115,6 +1115,17 @@ export class AgentManager {
agent.currentAssistantMessageId = null;
agent.currentThoughtId = null;
}
// Handle mode changes
if (update.update.sessionUpdate === "current_mode_update") {
const newModeId = update.update.currentModeId;
const runtime = this.getRuntime(agent);
if (runtime && runtime.currentModeId !== newModeId) {
console.log(`[Agent ${agentId}] Mode changed: ${runtime.currentModeId} -> ${newModeId}`);
runtime.currentModeId = newModeId;
}
}
}
// Create agent update with enriched notification wrapped in discriminated union