aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-orchestrator.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/module-orchestrator.js')
-rw-r--r--modules/core/module-orchestrator.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/core/module-orchestrator.js b/modules/core/module-orchestrator.js
index b695974..5cff89e 100644
--- a/modules/core/module-orchestrator.js
+++ b/modules/core/module-orchestrator.js
@@ -1150,7 +1150,9 @@ class OrchestratorModule {
try {
const aiModule = this.terminal.moduleManager.modules['WebX11AIAssistantModule'];
if (aiModule && typeof aiModule.chat === 'function') {
- const result = await aiModule.chat([`[DELEGATED] ${task}`], { agentTag: agent.id + '/' + (agent.role || 'worker') });
+ const _agentTag = agent.id + '/' + (agent.role || 'worker');
+ const result = await aiModule.chat([`[DELEGATED] ${task}`], { agentTag: _agentTag });
+ try { aiModule._sessions.delete(_agentTag); } catch (_e) {}
agent.status = 'completed';
// Write result to outbox