agentgui 1.0.439 → 1.0.441
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.
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { execSync, spawn } from 'child_process';
|
|
5
|
-
import { ensureRunning, touch } from './acp-manager.js';
|
|
5
|
+
import { ensureRunning, touch, queryModels } from './acp-manager.js';
|
|
6
6
|
|
|
7
7
|
function spawnScript(cmd, args, convId, scriptName, agentId, deps) {
|
|
8
8
|
const { activeScripts, broadcastSync, modelCache } = deps;
|
|
@@ -145,14 +145,7 @@ export function register(router, deps) {
|
|
|
145
145
|
} else {
|
|
146
146
|
const agent = discoveredAgents.find(x => x.id === p.id);
|
|
147
147
|
if (agent?.protocol === 'acp') {
|
|
148
|
-
|
|
149
|
-
if (port) {
|
|
150
|
-
try {
|
|
151
|
-
const data = await acpFetch(port, '/models');
|
|
152
|
-
const list = data?.data || data?.models || (Array.isArray(data) ? data : []);
|
|
153
|
-
models = list.map(m => ({ id: m.id || m.model_id, label: m.name || m.display_name || m.id || m.model_id })).filter(m => m.id);
|
|
154
|
-
} catch (_) {}
|
|
155
|
-
}
|
|
148
|
+
models = await queryModels(p.id);
|
|
156
149
|
}
|
|
157
150
|
}
|
|
158
151
|
if (models.length > 0) modelCache.set(p.id, { models, ts: Date.now() });
|