open-agents-ai 0.85.0 → 0.86.0

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.
Files changed (2) hide show
  1. package/dist/index.js +43 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -11239,6 +11239,8 @@ const cmdFile = join(nexusDir, 'cmd.json');
11239
11239
  const respFile = join(nexusDir, 'resp.json');
11240
11240
  const statusFile = join(nexusDir, 'status.json');
11241
11241
  const inboxDir = join(nexusDir, 'inbox');
11242
+ const logFile = join(nexusDir, 'daemon.log');
11243
+ function dlog(msg) { try { appendFileSync(logFile, new Date().toISOString() + ' ' + msg + '\\n'); } catch {} }
11242
11244
  const pidFile = join(nexusDir, 'daemon.pid');
11243
11245
  const invocationsDir = join(nexusDir, 'invocations');
11244
11246
  const meteringFile = join(nexusDir, 'metering.jsonl');
@@ -11292,6 +11294,7 @@ function writeResp(id, result) {
11292
11294
 
11293
11295
  async function handleCmd(cmd) {
11294
11296
  const { id, action, args } = cmd;
11297
+ dlog('handleCmd: action=' + action + ' id=' + id);
11295
11298
  try {
11296
11299
  switch (action) {
11297
11300
  case 'join_room': {
@@ -11374,8 +11377,19 @@ async function handleCmd(cmd) {
11374
11377
  const capability = args.capability || 'text-generation';
11375
11378
  const input = args.input || {};
11376
11379
  if (!peerId) { writeResp(id, { ok: false, output: 'target_peer is required' }); return; }
11377
- const result = await nexus.invokeCapability(peerId, capability, typeof input === 'string' ? { prompt: input } : input, { stream: false, maxDurationMs: 60000 });
11378
- writeResp(id, { ok: true, output: JSON.stringify(result, null, 2) });
11380
+ dlog('invoke_capability: peer=' + peerId.slice(0, 20) + ' cap=' + capability);
11381
+ try {
11382
+ // Wrap in a 90s timeout to prevent hangs from nexus library issues
11383
+ const INVOKE_TIMEOUT = 90_000;
11384
+ const invokePromise = nexus.invokeCapability(peerId, capability, typeof input === 'string' ? { prompt: input } : input, { stream: false, maxDurationMs: 60000 });
11385
+ const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('invoke_capability timed out after ' + (INVOKE_TIMEOUT / 1000) + 's (client-side timeout)')), INVOKE_TIMEOUT));
11386
+ const result = await Promise.race([invokePromise, timeoutPromise]);
11387
+ dlog('invoke_capability: SUCCESS');
11388
+ writeResp(id, { ok: true, output: JSON.stringify(result, null, 2) });
11389
+ } catch (invokeErr) {
11390
+ dlog('invoke_capability: ERROR ' + (invokeErr.message || String(invokeErr)));
11391
+ writeResp(id, { ok: false, output: 'Invoke error: ' + (invokeErr.message || String(invokeErr)) });
11392
+ }
11379
11393
  break;
11380
11394
  }
11381
11395
  case 'store_content': {
@@ -11773,7 +11787,9 @@ setInterval(() => {
11773
11787
  const cmd = JSON.parse(raw);
11774
11788
  if (cmd.id === lastCmdId) return; // already processed
11775
11789
  lastCmdId = cmd.id;
11776
- handleCmd(cmd);
11790
+ handleCmd(cmd).catch((err) => {
11791
+ writeResp(cmd.id, { ok: false, output: 'Error: ' + (err.message || String(err)) });
11792
+ });
11777
11793
  } catch {}
11778
11794
  }, 500);
11779
11795
 
@@ -12000,10 +12016,10 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
12000
12016
  result = await this.doSendDM(args);
12001
12017
  break;
12002
12018
  case "find_agent":
12003
- result = await this.sendDaemonCmd("find_agent", args);
12019
+ result = await this.sendDaemonCmd("find_agent", args, 3e4);
12004
12020
  break;
12005
12021
  case "invoke_capability":
12006
- result = await this.sendDaemonCmd("invoke_capability", args);
12022
+ result = await this.sendDaemonCmd("invoke_capability", args, 1e5);
12007
12023
  break;
12008
12024
  case "store_content":
12009
12025
  result = await this.sendDaemonCmd("store_content", args);
@@ -40683,7 +40699,7 @@ ${result.text}`;
40683
40699
  const steerPrompt = [
40684
40700
  `The user typed a mid-task message while the agent is working. Your job:`,
40685
40701
  `1. Understand what the user wants changed/added/corrected`,
40686
- `2. Produce a brief spoken acknowledgment (1 sentence, conversational)`,
40702
+ `2. Produce a brief, UNIQUE spoken acknowledgment that reflects WHAT they asked for`,
40687
40703
  `3. Expand their input into a clear, structured steering instruction for the main agent`,
40688
40704
  ``,
40689
40705
  `Current task goal: "${steerTaskGoal.slice(0, 500)}"`,
@@ -40694,11 +40710,30 @@ ${result.text}`;
40694
40710
  `User's mid-task message: "${input}"`,
40695
40711
  ``,
40696
40712
  `Call task_complete with:`,
40697
- `- acknowledgment: brief spoken response to the user (e.g. "Got it, I'll adjust the approach")`,
40713
+ `- acknowledgment: a brief spoken response SPECIFIC to what the user said. Reference the actual change they want. DO NOT use generic phrases like "Got it" or "adjusting". Instead describe what you'll do differently. Examples of GOOD acknowledgments:`,
40714
+ ` - "Switching to the new API endpoint now"`,
40715
+ ` - "Right, I'll use TypeScript instead"`,
40716
+ ` - "Understood, dropping the database mock"`,
40717
+ ` - "On it, pulling in that dependency first"`,
40718
+ ` - "Yep, let me rethink the caching layer"`,
40719
+ ` - "Makes sense, I'll refactor that into a separate module"`,
40698
40720
  `- summary: expanded instruction for the main agent (e.g. "USER STEERING: The user wants X instead of Y. Adjust your approach to prioritize Z. Specifically, they are asking you to...")`
40699
40721
  ].join("\n");
40700
40722
  const result = await steerAgent.run(steerPrompt, "Steering sub-agent \u2014 interpret user input and produce instruction.");
40701
- let acknowledgment = "Got it, adjusting.";
40723
+ const STEER_FALLBACKS = [
40724
+ `Noted, changing course.`,
40725
+ `On it, shifting approach.`,
40726
+ `Understood, recalibrating.`,
40727
+ `Right, let me rework that.`,
40728
+ `Okay, taking a different angle.`,
40729
+ `Heard you, pivoting now.`,
40730
+ `Sure thing, rethinking this.`,
40731
+ `Copy that, adapting.`,
40732
+ `Makes sense, re-routing.`,
40733
+ `Roger, new plan.`
40734
+ ];
40735
+ const fbIdx = Math.floor(Math.random() * STEER_FALLBACKS.length);
40736
+ let acknowledgment = STEER_FALLBACKS[fbIdx];
40702
40737
  let steering = `USER STEERING: ${input}`;
40703
40738
  try {
40704
40739
  const parsed = JSON.parse(result.summary || "{}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -70,6 +70,6 @@
70
70
  },
71
71
  "optionalDependencies": {
72
72
  "moondream": "^0.2.0",
73
- "open-agents-nexus": "^1.5.0"
73
+ "open-agents-nexus": "^1.5.6"
74
74
  }
75
75
  }