@openagents-org/agent-launcher 0.2.15 → 0.2.17

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/package.json +1 -1
  2. package/src/daemon.js +14 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-launcher",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/daemon.js CHANGED
@@ -209,14 +209,13 @@ class Daemon {
209
209
  }
210
210
  } catch {}
211
211
 
212
- // Wait for process to die
213
- for (let i = 0; i < 20; i++) {
214
- if (!Daemon._isAlive(pid)) {
215
- try { fs.unlinkSync(pidFile); } catch {}
216
- try { fs.unlinkSync(statusFile); } catch {}
217
- return true;
218
- }
219
- // Busy-wait 500ms (sync, used only in CLI stop command)
212
+ // Always clean up PID and status files after kill attempt
213
+ try { fs.unlinkSync(pidFile); } catch {}
214
+ try { fs.unlinkSync(statusFile); } catch {}
215
+
216
+ // Wait briefly for process to die
217
+ for (let i = 0; i < 5; i++) {
218
+ if (!Daemon._isAlive(pid)) return true;
220
219
  execSync(IS_WINDOWS ? 'ping -n 2 127.0.0.1 >nul' : 'sleep 0.5', {
221
220
  stdio: 'ignore', timeout: 5000,
222
221
  });
@@ -570,11 +569,18 @@ class Daemon {
570
569
  const cmd = line.trim();
571
570
  if (cmd.startsWith('stop:')) {
572
571
  const agentName = cmd.slice(5).trim();
572
+ this._log(`Command: stop ${agentName}`);
573
573
  this.stopAgent(agentName);
574
+ } else if (cmd.startsWith('start:')) {
575
+ const agentName = cmd.slice(6).trim();
576
+ this._log(`Command: start ${agentName}`);
577
+ this.restartAgent(agentName);
574
578
  } else if (cmd.startsWith('restart:')) {
575
579
  const agentName = cmd.slice(8).trim();
580
+ this._log(`Command: restart ${agentName}`);
576
581
  this.restartAgent(agentName);
577
582
  } else if (cmd === 'reload') {
583
+ this._log('Command: reload');
578
584
  this._reload();
579
585
  }
580
586
  }