@openagents-org/agent-launcher 0.2.162 → 0.2.164

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.162",
3
+ "version": "0.2.164",
4
4
  "description": "OpenAgents Launcher \u2014 install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/daemon.js CHANGED
@@ -136,6 +136,18 @@ class Daemon {
136
136
  * so the (synchronous, execSync-heavy) version/login probes never block the
137
137
  * daemon's event loop. Result is reported to the workspace on the heartbeat.
138
138
  */
139
+ /**
140
+ * Persist an agent's model. Sets the generic LLM_MODEL (used by LLM-direct
141
+ * adapters) plus the env var the agent's own CLI reads, so a model picked in
142
+ * the workspace actually takes effect (e.g. Claude reads ANTHROPIC_MODEL).
143
+ */
144
+ async _setModelEnv(type, model) {
145
+ const val = String(model || '');
146
+ const nativeVar = { claude: 'ANTHROPIC_MODEL', gemini: 'GEMINI_MODEL' }[type];
147
+ await this._runAgn(['env', type, '--set', `LLM_MODEL=${val}`]);
148
+ if (nativeVar) await this._runAgn(['env', type, '--set', `${nativeVar}=${val}`]);
149
+ }
150
+
139
151
  async _refreshRuntimes() {
140
152
  try {
141
153
  const r = await this._runAgn(['runtimes', '--json']);
@@ -174,7 +186,7 @@ class Daemon {
174
186
  // Optional credentials for API-key agents (generic → provider mapping
175
187
  // happens in env resolution).
176
188
  if (args.apiKey) await this._runAgn(['env', type, '--set', `LLM_API_KEY=${args.apiKey}`]);
177
- if (args.model) await this._runAgn(['env', type, '--set', `LLM_MODEL=${args.model}`]);
189
+ if (args.model) await this._setModelEnv(type, args.model);
178
190
  if (args.baseUrl) await this._runAgn(['env', type, '--set', `LLM_BASE_URL=${args.baseUrl}`]);
179
191
  // Attach to this node's workspace so the agent shows up as a member.
180
192
  const r2 = await this._runAgn(['connect', name, n.token, '--endpoint', n.endpoint]);
@@ -199,9 +211,7 @@ class Daemon {
199
211
  // recreate (agn has no in-place path change) at the new path.
200
212
  const type = (args.type || '').trim();
201
213
  if (args.apiKey) await this._runAgn(['env', type, '--set', `LLM_API_KEY=${args.apiKey}`]);
202
- if (args.model !== undefined) {
203
- await this._runAgn(['env', type, '--set', `LLM_MODEL=${String(args.model || '')}`]);
204
- }
214
+ if (args.model !== undefined) await this._setModelEnv(type, args.model);
205
215
  const newDir = (args.workingDir || '').trim();
206
216
  if (newDir && newDir !== (args.currentWorkingDir || '')) {
207
217
  try { fs.mkdirSync(newDir, { recursive: true }); } catch {}
@@ -135,6 +135,7 @@ class WorkspaceClient {
135
135
  if (deviceInfo.launcherVersion) body.launcher_version = deviceInfo.launcherVersion;
136
136
  if (Array.isArray(deviceInfo.agents)) body.agents = deviceInfo.agents;
137
137
  if (Array.isArray(deviceInfo.runtimes)) body.runtimes = deviceInfo.runtimes;
138
+ if (deviceInfo.fs && typeof deviceInfo.fs === 'object') body.fs = deviceInfo.fs;
138
139
  const data = await this._post('/v1/nodes/heartbeat', body, this._wsHeaders(token));
139
140
  return data.data || data;
140
141
  }