agentgui 1.0.802 → 1.0.804
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/server.js +9 -1
- package/static/js/client.js +14 -4
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -247,6 +247,9 @@ async function getModelsForAgent(agentId) {
|
|
|
247
247
|
if (agent?.protocol === 'acp') {
|
|
248
248
|
await ensureRunning(agentId);
|
|
249
249
|
try { models = await queryACPModels(agentId); } catch (_) {}
|
|
250
|
+
} else if (agent?.protocol === 'cli-wrapper' && agent.acpId) {
|
|
251
|
+
await ensureRunning(agent.acpId);
|
|
252
|
+
try { models = await queryACPModels(agent.acpId); } catch (_) {}
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
modelCache.set(agentId, { models, timestamp: Date.now() });
|
|
@@ -2191,7 +2194,12 @@ async function processMessageWithStreaming(conversationId, messageId, sessionId,
|
|
|
2191
2194
|
}
|
|
2192
2195
|
};
|
|
2193
2196
|
|
|
2194
|
-
|
|
2197
|
+
// Resolve cli-wrapper agent IDs (e.g. cli-kilo → kilo) to their underlying registered agent
|
|
2198
|
+
let resolvedAgentId = agentId || 'claude-code';
|
|
2199
|
+
const wrapperAgent = discoveredAgents.find(a => a.id === resolvedAgentId && a.protocol === 'cli-wrapper' && a.acpId);
|
|
2200
|
+
if (wrapperAgent) resolvedAgentId = wrapperAgent.acpId;
|
|
2201
|
+
|
|
2202
|
+
const { outputs, sessionId: claudeSessionId } = await runClaudeWithStreaming(content, cwd, resolvedAgentId, config);
|
|
2195
2203
|
|
|
2196
2204
|
// Check if rate limit was already handled in stream detection
|
|
2197
2205
|
if (rateLimitState.get(conversationId)?.isStreamDetected) {
|
package/static/js/client.js
CHANGED
|
@@ -221,8 +221,8 @@ class AgentGUIClient {
|
|
|
221
221
|
window.switchView('chat');
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
// Restore draft for new conversation
|
|
225
|
-
|
|
224
|
+
// Restore draft for new conversation synchronously (setTimeout caused races)
|
|
225
|
+
this.restoreDraftPrompt(convId);
|
|
226
226
|
});
|
|
227
227
|
|
|
228
228
|
// Preserve controls state across tab switches
|
|
@@ -639,15 +639,18 @@ class AgentGUIClient {
|
|
|
639
639
|
this.unlockAgentAndModel();
|
|
640
640
|
});
|
|
641
641
|
|
|
642
|
-
// Listen for conversation selection
|
|
642
|
+
// Listen for conversation selection (deduplicate rapid clicks)
|
|
643
643
|
window.addEventListener('conversation-selected', async (event) => {
|
|
644
644
|
const conversationId = event.detail.conversationId;
|
|
645
|
+
if (this._isLoadingConversation && this._loadingConversationId === conversationId) return;
|
|
646
|
+
this._loadingConversationId = conversationId;
|
|
645
647
|
this.updateUrlForConversation(conversationId);
|
|
646
648
|
this._isLoadingConversation = true;
|
|
647
649
|
try {
|
|
648
650
|
await this.loadConversationMessages(conversationId);
|
|
649
651
|
} finally {
|
|
650
652
|
this._isLoadingConversation = false;
|
|
653
|
+
this._loadingConversationId = null;
|
|
651
654
|
}
|
|
652
655
|
});
|
|
653
656
|
|
|
@@ -2843,7 +2846,7 @@ class AgentGUIClient {
|
|
|
2843
2846
|
|
|
2844
2847
|
const cached = this.conversationCache.get(conversationId);
|
|
2845
2848
|
if (cached) { this.conversationCache.delete(conversationId); this.conversationCache.set(conversationId, cached); }
|
|
2846
|
-
if (cached && (Date.now() - cached.timestamp) <
|
|
2849
|
+
if (cached && (Date.now() - cached.timestamp) < 600000) {
|
|
2847
2850
|
const outputEl = document.getElementById('output');
|
|
2848
2851
|
if (outputEl) {
|
|
2849
2852
|
const children = [];
|
|
@@ -2855,6 +2858,9 @@ class AgentGUIClient {
|
|
|
2855
2858
|
const cachedHasActivity = cached.conversation.messageCount > 0 || this._convIsStreaming(conversationId);
|
|
2856
2859
|
this.applyAgentAndModelSelection(cached.conversation, cachedHasActivity);
|
|
2857
2860
|
this.conversationCache.delete(conversationId);
|
|
2861
|
+
if (this._lazyObserver) { this._lazyObserver.disconnect(); this._lazyObserver = null; }
|
|
2862
|
+
this._flushBgCache && this._flushBgCache(conversationId);
|
|
2863
|
+
this.setupScrollUpDetection && this.setupScrollUpDetection();
|
|
2858
2864
|
this.syncPromptState(conversationId);
|
|
2859
2865
|
this.restoreScrollPosition(conversationId);
|
|
2860
2866
|
return;
|
|
@@ -2865,6 +2871,8 @@ class AgentGUIClient {
|
|
|
2865
2871
|
|
|
2866
2872
|
if (this._lazyObserver) { this._lazyObserver.disconnect(); this._lazyObserver = null; }
|
|
2867
2873
|
this._showSkeletonLoading(conversationId);
|
|
2874
|
+
// Yield to let skeleton paint before blocking on RPC
|
|
2875
|
+
await new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)));
|
|
2868
2876
|
|
|
2869
2877
|
let fullData;
|
|
2870
2878
|
try {
|
|
@@ -2990,6 +2998,8 @@ class AgentGUIClient {
|
|
|
2990
2998
|
if (chunks.length > 0) {
|
|
2991
2999
|
const activeSessionId = (shouldResumeStreaming && latestSession) ? latestSession.id : null;
|
|
2992
3000
|
performance.mark(`conv-render-start:${conversationId}`);
|
|
3001
|
+
// Yield before heavy render to let header paint
|
|
3002
|
+
await new Promise(r => requestAnimationFrame(r));
|
|
2993
3003
|
if (!convSignal.aborted) this._renderConversationContent(messagesEl, chunks, userMessages, activeSessionId);
|
|
2994
3004
|
performance.mark(`conv-render-complete:${conversationId}`);
|
|
2995
3005
|
performance.measure(`conv-render:${conversationId}`, `conv-render-start:${conversationId}`, `conv-render-complete:${conversationId}`);
|