agentgui 1.0.641 → 1.0.642
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/lib/ws-handlers-util.js +2 -3
- package/package.json +1 -1
- package/server.js +5 -2
- package/static/js/client.js +5 -5
package/lib/ws-handlers-util.js
CHANGED
|
@@ -284,9 +284,8 @@ export function register(router, deps) {
|
|
|
284
284
|
const output = result.stdout.trim();
|
|
285
285
|
// Output format: ' agentId · model' lines under section headers
|
|
286
286
|
const agents = [];
|
|
287
|
-
for (const line of output.split('
|
|
288
|
-
|
|
289
|
-
const match = line.match(/^s{2}(S+)s+·/);
|
|
287
|
+
for (const line of output.split('\n').filter(l => l.trim())) {
|
|
288
|
+
const match = line.match(/^ (\S+)\s+·/);
|
|
290
289
|
if (match) {
|
|
291
290
|
const id = match[1];
|
|
292
291
|
agents.push({ id, name: id });
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -534,9 +534,12 @@ function discoverAgents() {
|
|
|
534
534
|
console.log(`[discoverAgents] Skipping CLI wrapper ${wrapper.id} (ACP agent ${wrapper.acpId} not found)`);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
|
|
537
|
+
// Remove raw ACP agents that have a cli-wrapper (avoid duplicates in UI)
|
|
538
|
+
const wrappedAcpIds = new Set(cliWrappers.filter(w => agents.some(a => a.id === w.acpId)).map(w => w.acpId));
|
|
539
|
+
const filtered = agents.filter(a => !wrappedAcpIds.has(a.id));
|
|
540
|
+
console.log('[discoverAgents] Final agent count:', filtered.length, 'Agent IDs:', filtered.map(a => a.id).join(', '));
|
|
538
541
|
|
|
539
|
-
return
|
|
542
|
+
return filtered;
|
|
540
543
|
}
|
|
541
544
|
|
|
542
545
|
// Function to discover agents from external ACP servers
|
package/static/js/client.js
CHANGED
|
@@ -442,10 +442,10 @@ class AgentGUIClient {
|
|
|
442
442
|
|
|
443
443
|
if (this.ui.agentSelector) {
|
|
444
444
|
this.ui.agentSelector.addEventListener('change', () => {
|
|
445
|
-
// Load models for
|
|
446
|
-
const
|
|
447
|
-
if (
|
|
448
|
-
this.loadModelsForAgent(
|
|
445
|
+
// Load models for parent CLI agent when sub-agent changes
|
|
446
|
+
const parentAgentId = this.ui.cliSelector?.value;
|
|
447
|
+
if (parentAgentId) {
|
|
448
|
+
this.loadModelsForAgent(parentAgentId);
|
|
449
449
|
}
|
|
450
450
|
if (!this._agentLocked) {
|
|
451
451
|
this.saveAgentAndModelToConversation();
|
|
@@ -2076,7 +2076,7 @@ class AgentGUIClient {
|
|
|
2076
2076
|
// Auto-select first sub-agent and load its models
|
|
2077
2077
|
const firstSubAgentId = subAgents[0].id;
|
|
2078
2078
|
this.ui.agentSelector.value = firstSubAgentId;
|
|
2079
|
-
this.loadModelsForAgent(
|
|
2079
|
+
this.loadModelsForAgent(cliAgentId); // models keyed to parent agent
|
|
2080
2080
|
} else {
|
|
2081
2081
|
console.log(`[Agent Selector] No sub-agents found for ${cliAgentId}`);
|
|
2082
2082
|
// Load models for the CLI agent itself (fallback for agents without sub-agents)
|