@openagents-org/agent-launcher 0.2.120 → 0.2.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/adapters/base.js +12 -0
- package/src/adapters/claude.js +27 -4
- package/src/cli.js +3 -3
- package/src/daemon.js +1 -1
package/package.json
CHANGED
package/src/adapters/base.js
CHANGED
|
@@ -500,6 +500,18 @@ class BaseAdapter {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
+
async getRemainingTodos(channel) {
|
|
504
|
+
try {
|
|
505
|
+
const result = await this.client.getTodos(this.workspaceId, channel, this.token, {
|
|
506
|
+
all: false,
|
|
507
|
+
});
|
|
508
|
+
const todos = (result && result.todos) || [];
|
|
509
|
+
return todos.filter((t) => t.status === 'pending' || t.status === 'in_progress');
|
|
510
|
+
} catch {
|
|
511
|
+
return [];
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
503
515
|
async sendTodos(channel, todos) {
|
|
504
516
|
try {
|
|
505
517
|
await this.client.putTodos(this.workspaceId, channel, this.token, todos, {
|
package/src/adapters/claude.js
CHANGED
|
@@ -32,7 +32,7 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
32
32
|
super(opts);
|
|
33
33
|
this.disabledModules = opts.disabledModules || new Set();
|
|
34
34
|
/** @type {'mcp' | 'skills'} Tool integration mode */
|
|
35
|
-
this.toolMode = opts.toolMode || '
|
|
35
|
+
this.toolMode = opts.toolMode || 'skills';
|
|
36
36
|
this._channelSessions = {}; // channel → Claude CLI session_id
|
|
37
37
|
this._channelProcesses = {}; // channel → child process
|
|
38
38
|
this._stoppingChannels = new Set();
|
|
@@ -798,10 +798,33 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
798
798
|
|
|
799
799
|
delete this._channelProcesses[msgChannel];
|
|
800
800
|
|
|
801
|
-
// Clean up stale todos: mark pending/in_progress as cancelled
|
|
802
|
-
try { await this.cleanupTodos(msgChannel); } catch {}
|
|
803
|
-
|
|
804
801
|
const stoppedByUser = this._stoppingChannels.has(msgChannel);
|
|
802
|
+
|
|
803
|
+
if (stoppedByUser) {
|
|
804
|
+
// User explicitly stopped — cancel all remaining todos
|
|
805
|
+
try { await this.cleanupTodos(msgChannel); } catch {}
|
|
806
|
+
} else if (!msg._todoNudge) {
|
|
807
|
+
// Normal exit (not already a nudge) — check for remaining pending todos
|
|
808
|
+
try {
|
|
809
|
+
const remaining = await this.getRemainingTodos(msgChannel);
|
|
810
|
+
if (remaining.length > 0) {
|
|
811
|
+
const items = remaining.map((t) => `- ${t.content}`).join('\n');
|
|
812
|
+
const nudge = `You have ${remaining.length} remaining task(s) from your plan:\n${items}\n\nPlease continue working on them.`;
|
|
813
|
+
if (!this._channelQueues[msgChannel]) this._channelQueues[msgChannel] = [];
|
|
814
|
+
this._channelQueues[msgChannel].push({
|
|
815
|
+
content: nudge,
|
|
816
|
+
senderType: 'system',
|
|
817
|
+
senderName: 'system:todos',
|
|
818
|
+
sessionId: msgChannel,
|
|
819
|
+
messageType: 'chat',
|
|
820
|
+
_todoNudge: true,
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
} catch {}
|
|
824
|
+
} else {
|
|
825
|
+
// Nudge response finished but todos still pending — cancel to avoid infinite loop
|
|
826
|
+
try { await this.cleanupTodos(msgChannel); } catch {}
|
|
827
|
+
}
|
|
805
828
|
if (stoppedByUser) {
|
|
806
829
|
this._stoppingChannels.delete(msgChannel);
|
|
807
830
|
resolve(false);
|
package/src/cli.js
CHANGED
|
@@ -456,7 +456,7 @@ async function cmdToolMode(connector, _flags, positional) {
|
|
|
456
456
|
if (agents.length === 0) { print('No agents configured'); return; }
|
|
457
457
|
for (const a of agents) {
|
|
458
458
|
connector.config.updateAgent(a.name, { tool_mode: targetMode });
|
|
459
|
-
print(` ${a.name}: ${a.tool_mode || '
|
|
459
|
+
print(` ${a.name}: ${a.tool_mode || 'skills'} → ${targetMode}`);
|
|
460
460
|
}
|
|
461
461
|
try { connector.sendDaemonCommand('reload'); } catch {}
|
|
462
462
|
print(`\nSet all ${agents.length} agent(s) to '${targetMode}' mode.`);
|
|
@@ -471,7 +471,7 @@ async function cmdToolMode(connector, _flags, positional) {
|
|
|
471
471
|
return;
|
|
472
472
|
}
|
|
473
473
|
for (const a of agents) {
|
|
474
|
-
print(` ${a.name}: ${a.tool_mode || '
|
|
474
|
+
print(` ${a.name}: ${a.tool_mode || 'skills'}`);
|
|
475
475
|
}
|
|
476
476
|
print('\nUsage: agn tool-mode <agent|--all> <mcp|skills>');
|
|
477
477
|
return;
|
|
@@ -481,7 +481,7 @@ async function cmdToolMode(connector, _flags, positional) {
|
|
|
481
481
|
// Show tool mode for specific agent
|
|
482
482
|
const agent = connector.config.getAgent(first);
|
|
483
483
|
if (!agent) { print(`Agent '${first}' not found`); process.exitCode = 1; return; }
|
|
484
|
-
print(`${first}: ${agent.tool_mode || '
|
|
484
|
+
print(`${first}: ${agent.tool_mode || 'skills'}`);
|
|
485
485
|
print('\nUsage: agn tool-mode <agent|--all> <mcp|skills>');
|
|
486
486
|
return;
|
|
487
487
|
}
|
package/src/daemon.js
CHANGED
|
@@ -445,7 +445,7 @@ class Daemon {
|
|
|
445
445
|
disabledModules: new Set(),
|
|
446
446
|
agentEnv: this._buildAgentEnv(agentCfg),
|
|
447
447
|
workingDir: agentCfg.path || undefined,
|
|
448
|
-
toolMode: agentCfg.tool_mode || '
|
|
448
|
+
toolMode: agentCfg.tool_mode || 'skills',
|
|
449
449
|
});
|
|
450
450
|
} catch (e) {
|
|
451
451
|
this._log(`${name} failed to create ${agentType} adapter: ${e.message}`);
|