agentgui 1.0.221 → 1.0.222
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/static/js/client.js +19 -4
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -1117,7 +1117,8 @@ class AgentGUIClient {
|
|
|
1117
1117
|
async startExecution() {
|
|
1118
1118
|
const prompt = this.ui.messageInput?.value || '';
|
|
1119
1119
|
const conv = this.state.currentConversation;
|
|
1120
|
-
const
|
|
1120
|
+
const isNewConversation = conv && !conv.messageCount && !this.state.streamingConversations.has(conv.id);
|
|
1121
|
+
const agentId = (isNewConversation ? this.ui.agentSelector?.value : null) || conv?.agentType || this.ui.agentSelector?.value || 'claude-code';
|
|
1121
1122
|
const model = this.ui.modelSelector?.value || null;
|
|
1122
1123
|
|
|
1123
1124
|
if (!prompt.trim()) {
|
|
@@ -1137,6 +1138,7 @@ class AgentGUIClient {
|
|
|
1137
1138
|
|
|
1138
1139
|
try {
|
|
1139
1140
|
if (conv?.id) {
|
|
1141
|
+
this.lockAgentAndModel(agentId, model);
|
|
1140
1142
|
await this.streamToConversation(conv.id, savedPrompt, agentId, model);
|
|
1141
1143
|
this._confirmOptimisticMessage(pendingId);
|
|
1142
1144
|
} else {
|
|
@@ -1942,7 +1944,6 @@ class AgentGUIClient {
|
|
|
1942
1944
|
}
|
|
1943
1945
|
|
|
1944
1946
|
const { conversation } = await response.json();
|
|
1945
|
-
this.lockAgentAndModel(agentId, model);
|
|
1946
1947
|
|
|
1947
1948
|
await this.loadConversations();
|
|
1948
1949
|
|
|
@@ -2018,7 +2019,14 @@ class AgentGUIClient {
|
|
|
2018
2019
|
outputEl.appendChild(cached.dom.firstChild);
|
|
2019
2020
|
}
|
|
2020
2021
|
this.state.currentConversation = cached.conversation;
|
|
2021
|
-
|
|
2022
|
+
const cachedHasActivity = cached.conversation.messageCount > 0 || this.state.streamingConversations.has(conversationId);
|
|
2023
|
+
if (cachedHasActivity) {
|
|
2024
|
+
this.lockAgentAndModel(cached.conversation.agentType || 'claude-code', cached.conversation.model || null);
|
|
2025
|
+
} else {
|
|
2026
|
+
this.unlockAgentAndModel();
|
|
2027
|
+
if (this.ui.agentSelector && cached.conversation.agentType) this.ui.agentSelector.value = cached.conversation.agentType;
|
|
2028
|
+
if (cached.conversation.agentType) this.loadModelsForAgent(cached.conversation.agentType);
|
|
2029
|
+
}
|
|
2022
2030
|
this.conversationCache.delete(conversationId);
|
|
2023
2031
|
this.restoreScrollPosition(conversationId);
|
|
2024
2032
|
this.enableControls();
|
|
@@ -2046,7 +2054,14 @@ class AgentGUIClient {
|
|
|
2046
2054
|
const { conversation, isActivelyStreaming, latestSession, chunks: rawChunks, totalChunks, messages: allMessages } = await resp.json();
|
|
2047
2055
|
|
|
2048
2056
|
this.state.currentConversation = conversation;
|
|
2049
|
-
|
|
2057
|
+
const hasActivity = (allMessages && allMessages.length > 0) || isActivelyStreaming || latestSession || this.state.streamingConversations.has(conversationId);
|
|
2058
|
+
if (hasActivity) {
|
|
2059
|
+
this.lockAgentAndModel(conversation.agentType || 'claude-code', conversation.model || null);
|
|
2060
|
+
} else {
|
|
2061
|
+
this.unlockAgentAndModel();
|
|
2062
|
+
if (this.ui.agentSelector && conversation.agentType) this.ui.agentSelector.value = conversation.agentType;
|
|
2063
|
+
if (conversation.agentType) this.loadModelsForAgent(conversation.agentType);
|
|
2064
|
+
}
|
|
2050
2065
|
|
|
2051
2066
|
const chunks = (rawChunks || []).map(chunk => ({
|
|
2052
2067
|
...chunk,
|