@openagents-org/agent-launcher 0.2.172 → 0.2.173
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 +1 -1
- package/src/adapters/base.js +13 -0
- package/src/adapters/claude.js +10 -2
- package/src/workspace-client.js +1 -0
package/package.json
CHANGED
package/src/adapters/base.js
CHANGED
|
@@ -81,6 +81,10 @@ class BaseAdapter {
|
|
|
81
81
|
this._processedIds = new Set();
|
|
82
82
|
this._titledSessions = new Set();
|
|
83
83
|
this._mode = 'execute';
|
|
84
|
+
// Workspace-selected model id (WorkspaceMember.model). Synced from
|
|
85
|
+
// discover at startup and via the `model.set` control event; null means
|
|
86
|
+
// the agent CLI runs with its own default.
|
|
87
|
+
this.workspaceModel = null;
|
|
84
88
|
this._lastControlId = null;
|
|
85
89
|
this._controlWake = null;
|
|
86
90
|
// Per-channel task tracking for parallel execution
|
|
@@ -212,6 +216,10 @@ class BaseAdapter {
|
|
|
212
216
|
this.disabledModules = skillsToDisabledModules(self.enabledSkills);
|
|
213
217
|
this._log(`Synced skills from workspace: disabled=[${[...this.disabledModules].join(',')}]`);
|
|
214
218
|
}
|
|
219
|
+
if (self && self.model) {
|
|
220
|
+
this.workspaceModel = self.model;
|
|
221
|
+
this._log(`Synced model from workspace: ${this.workspaceModel}`);
|
|
222
|
+
}
|
|
215
223
|
} catch (e) {
|
|
216
224
|
this._log(`Warning: skill sync failed (non-fatal): ${e.message}`);
|
|
217
225
|
}
|
|
@@ -360,6 +368,11 @@ class BaseAdapter {
|
|
|
360
368
|
await this._handleSkillInstall(payload);
|
|
361
369
|
} else if (action === 'skill.uninstall') {
|
|
362
370
|
await this._handleSkillUninstall(payload);
|
|
371
|
+
} else if (action === 'model.set') {
|
|
372
|
+
// Adapters read workspaceModel when (re)spawning their CLI; ones with
|
|
373
|
+
// a staleness check (claude.js) respawn on the next message.
|
|
374
|
+
this.workspaceModel = (payload && payload.model) || null;
|
|
375
|
+
this._log(`Workspace model set to ${this.workspaceModel || '(default)'}`);
|
|
363
376
|
}
|
|
364
377
|
}
|
|
365
378
|
|
package/src/adapters/claude.js
CHANGED
|
@@ -471,6 +471,10 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
471
471
|
const cmd = [claudeBin, '-p', prompt, '--output-format', 'stream-json', '--verbose'];
|
|
472
472
|
|
|
473
473
|
cmd.push('--append-system-prompt', systemPrompt);
|
|
474
|
+
// Workspace-picked model (agent profile panel). Absent = CLI's own default.
|
|
475
|
+
if (this.workspaceModel) {
|
|
476
|
+
cmd.push('--model', this.workspaceModel);
|
|
477
|
+
}
|
|
474
478
|
const disallowedTools = ['AskUserQuestion', 'CronCreate', 'CronDelete', 'CronList', 'ScheduleWakeup'];
|
|
475
479
|
if (browserEnabled) {
|
|
476
480
|
// Hard-ban the native WebFetch: it can't render JS and bypasses the
|
|
@@ -1165,13 +1169,16 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
1165
1169
|
// read-only plan process serving execute requests.
|
|
1166
1170
|
const modeStale = existingPP.spawnMode !== this._mode;
|
|
1167
1171
|
const pinnedStale = pinnedHash !== null && existingPP.pinnedHash !== pinnedHash;
|
|
1168
|
-
|
|
1172
|
+
const modelStale = (existingPP.spawnModel || null) !== (this.workspaceModel || null);
|
|
1173
|
+
if (modeStale || pinnedStale || modelStale) {
|
|
1169
1174
|
// Kill it and fall through to a fresh spawn: --resume keeps the
|
|
1170
1175
|
// conversation (it lives in the CLI transcript), while the new spawn
|
|
1171
1176
|
// carries the current mode and re-pins the current knowledge.
|
|
1172
1177
|
this._log(modeStale
|
|
1173
1178
|
? `Mode changed to ${this._mode} for ${msgChannel} — respawning with resume`
|
|
1174
|
-
:
|
|
1179
|
+
: modelStale
|
|
1180
|
+
? `Model changed to ${this.workspaceModel || '(default)'} for ${msgChannel} — respawning with resume`
|
|
1181
|
+
: `Pinned knowledge changed for ${msgChannel} — respawning with resume to re-pin it`);
|
|
1175
1182
|
await this._killPersistentProc(msgChannel);
|
|
1176
1183
|
} else {
|
|
1177
1184
|
this._log(`Reusing persistent process for ${msgChannel}`);
|
|
@@ -1258,6 +1265,7 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
1258
1265
|
{ entryId: glossaryOpt && glossaryOpt.entryId, content: glossaryOpt && glossaryOpt.content },
|
|
1259
1266
|
]);
|
|
1260
1267
|
pp.spawnMode = this._mode;
|
|
1268
|
+
pp.spawnModel = this.workspaceModel || null;
|
|
1261
1269
|
this._log(`Spawned persistent process for ${msgChannel} (attempt ${attempt + 1})`);
|
|
1262
1270
|
|
|
1263
1271
|
const result = await this._sendToPersistentProc(pp, effectiveContent);
|