agentgui 1.0.643 → 1.0.644

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.643",
3
+ "version": "1.0.644",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -1605,7 +1605,12 @@ class AgentGUIClient {
1605
1605
  }
1606
1606
 
1607
1607
  const pendingId = 'pending-' + Date.now() + '-' + Math.random().toString(36).substr(2, 6);
1608
- this._showOptimisticMessage(pendingId, savedPrompt);
1608
+
1609
+ // Check if streaming - only show optimistic message if NOT queuing
1610
+ const isStreaming = this.state.currentConversation && this.state.streamingConversations.has(this.state.currentConversation.id);
1611
+ if (!isStreaming) {
1612
+ this._showOptimisticMessage(pendingId, savedPrompt);
1613
+ }
1609
1614
 
1610
1615
  try {
1611
1616
  let conv = this.state.currentConversation;
@@ -1631,7 +1636,10 @@ class AgentGUIClient {
1631
1636
  this.lockAgentAndModel(agentId, model);
1632
1637
  await this.streamToConversation(conv.id, savedPrompt, agentId, model, subAgent);
1633
1638
  this.clearDraft(conv.id);
1634
- this._confirmOptimisticMessage(pendingId);
1639
+ // Only confirm optimistic message if it was shown (not queued)
1640
+ if (!isStreaming) {
1641
+ this._confirmOptimisticMessage(pendingId);
1642
+ }
1635
1643
  } else {
1636
1644
  const agentId = this.getCurrentAgent();
1637
1645
  const subAgent = this.getEffectiveSubAgent() || null;
@@ -1656,7 +1664,10 @@ class AgentGUIClient {
1656
1664
  }
1657
1665
  } catch (error) {
1658
1666
  console.error('Execution error:', error);
1659
- this._failOptimisticMessage(pendingId, savedPrompt, error.message);
1667
+ // Only fail optimistic message if it was shown
1668
+ if (!isStreaming) {
1669
+ this._failOptimisticMessage(pendingId, savedPrompt, error.message);
1670
+ }
1660
1671
  this.enableControls();
1661
1672
  }
1662
1673
  }
@@ -2076,7 +2087,7 @@ class AgentGUIClient {
2076
2087
  // Auto-select first sub-agent and load its models
2077
2088
  const firstSubAgentId = subAgents[0].id;
2078
2089
  this.ui.agentSelector.value = firstSubAgentId;
2079
- this.loadModelsForAgent(cliAgentId); // models keyed to parent agent
2090
+ this.loadModelsForAgent(cliAgentId); // models keyed to parent agent
2080
2091
  } else {
2081
2092
  console.log(`[Agent Selector] No sub-agents found for ${cliAgentId}`);
2082
2093
  // Load models for the CLI agent itself (fallback for agents without sub-agents)