agentgui 1.0.692 → 1.0.694

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.
@@ -255,7 +255,8 @@ class AgentRunner {
255
255
  resolve({ outputs, sessionId });
256
256
  } else {
257
257
  const stderrHint = stderrBuffer.trim() ? `: ${stderrBuffer.trim().slice(0, 200)}` : '';
258
- reject(new Error(`${this.name} exited with code ${code}${stderrHint}`));
258
+ const codeHint = code === 143 ? ' (SIGTERM - process was killed)' : code === 137 ? ' (SIGKILL - out of memory or force-killed)' : '';
259
+ reject(new Error(`${this.name} exited with code ${code}${codeHint}${stderrHint}`));
259
260
  }
260
261
  });
261
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.692",
3
+ "version": "1.0.694",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -4437,14 +4437,32 @@ if (watch) {
4437
4437
  } catch (e) { console.error('Watch error:', e.message); }
4438
4438
  }
4439
4439
 
4440
+ function killActiveExecutions() {
4441
+ for (const [convId, entry] of activeExecutions.entries()) {
4442
+ if (entry.pid) {
4443
+ try { process.kill(-entry.pid, 'SIGTERM'); } catch { try { process.kill(entry.pid, 'SIGTERM'); } catch (_) {} }
4444
+ }
4445
+ if (entry.proc) {
4446
+ try { entry.proc.kill('SIGTERM'); } catch (_) {}
4447
+ }
4448
+ }
4449
+ activeExecutions.clear();
4450
+ }
4451
+
4440
4452
  process.on('SIGTERM', () => {
4441
4453
  console.log('[SIGNAL] SIGTERM received - graceful shutdown');
4454
+ if (!watch) killActiveExecutions();
4442
4455
  try { pm2Manager.disconnect(); } catch (_) {}
4443
4456
  stopACPTools().catch(() => {}).finally(() => {
4444
4457
  try { wss.close(() => server.close(() => process.exit(0))); } catch (_) { process.exit(0); }
4445
4458
  });
4446
4459
  });
4447
4460
 
4461
+ process.on('SIGINT', () => {
4462
+ killActiveExecutions();
4463
+ process.exit(0);
4464
+ });
4465
+
4448
4466
  server.on('error', (err) => {
4449
4467
  if (err.code === 'EADDRINUSE') {
4450
4468
  console.error(`Port ${PORT} already in use. Waiting 3 seconds before retry...`);