@openagents-org/agent-launcher 0.2.17 → 0.2.19

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-launcher",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -207,6 +207,7 @@ class OpenClawAdapter extends BaseAdapter {
207
207
  stdio: ['ignore', 'pipe', 'pipe'],
208
208
  env: spawnEnv,
209
209
  timeout: 600000,
210
+ windowsHide: true,
210
211
  };
211
212
 
212
213
  if (IS_WINDOWS) {
package/src/daemon.js CHANGED
@@ -107,7 +107,16 @@ class Daemon {
107
107
  */
108
108
  async stopAgent(agentName) {
109
109
  this._stoppedAgents.add(agentName);
110
+ // Stop the adapter directly if running
111
+ if (this._adapters && this._adapters[agentName]) {
112
+ this._adapters[agentName].stop();
113
+ }
110
114
  await this._killAgent(agentName, 5000);
115
+ // Wait for adapter loop to actually exit
116
+ for (let i = 0; i < 10; i++) {
117
+ if (!this._adapters || !this._adapters[agentName]) break;
118
+ await new Promise(r => setTimeout(r, 500));
119
+ }
111
120
  this._writeStatus();
112
121
  }
113
122
 
@@ -118,6 +127,9 @@ class Daemon {
118
127
  await this.stopAgent(agentName);
119
128
  this._stoppedAgents.delete(agentName);
120
129
 
130
+ // Reload config in case it changed
131
+ this.config.load();
132
+
121
133
  const agent = this.config.getAgent(agentName);
122
134
  if (agent) {
123
135
  this._launchAgent(agent);
@@ -598,11 +610,12 @@ class Daemon {
598
610
  } catch {}
599
611
  }
600
612
 
601
- _reload() {
613
+ async _reload() {
602
614
  this._log('Reloading config...');
603
615
  const oldNames = this._cachedAgentNames || new Set();
604
616
  const oldConfigs = this._cachedAgentConfigs || {};
605
617
  // Re-read config from disk
618
+ this.config.load();
606
619
  const newAgents = this.config.getAgents();
607
620
  const newNames = new Set(newAgents.map(a => a.name));
608
621
  const newConfigs = {};
@@ -611,7 +624,7 @@ class Daemon {
611
624
  // Stop removed agents
612
625
  for (const name of oldNames) {
613
626
  if (!newNames.has(name)) {
614
- this.stopAgent(name);
627
+ await this.stopAgent(name);
615
628
  this._log(`Reload: stopped removed agent '${name}'`);
616
629
  }
617
630
  }
@@ -623,7 +636,8 @@ class Daemon {
623
636
  this._log(`Reload: started new agent '${agent.name}'`);
624
637
  } else if ((oldConfigs[agent.name] || '') !== (agent.network || '')) {
625
638
  // Network config changed — restart agent
626
- this.stopAgent(agent.name);
639
+ await this.stopAgent(agent.name);
640
+ this._stoppedAgents.delete(agent.name);
627
641
  this._launchAgent(agent);
628
642
  this._log(`Reload: restarted '${agent.name}' (network changed)`);
629
643
  }
@@ -652,7 +666,9 @@ class Daemon {
652
666
  fs.appendFileSync(this.config.logFile, line + '\n', 'utf-8');
653
667
  this._maybeRotateLog();
654
668
  } catch {}
655
- if (!this._shuttingDown) {
669
+ // Only log to console if stdout is a TTY (not redirected to log file)
670
+ // to avoid duplicate lines when daemonized
671
+ if (!this._shuttingDown && process.stdout.isTTY) {
656
672
  console.log(line);
657
673
  }
658
674
  }