agentgui 1.0.557 → 1.0.559

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/database.js CHANGED
@@ -677,12 +677,11 @@ export const queries = {
677
677
 
678
678
  getResumableConversations() {
679
679
  // Get conversations with active/pending sessions that can be resumed
680
- // Include conversations regardless of isStreaming flag - check database for actual active sessions
680
+ // Check sessions table directly for actual active status, don't filter by claudeSessionId
681
681
  const stmt = prep(
682
682
  `SELECT DISTINCT c.id, c.title, c.claudeSessionId, c.agentId, c.agentType, c.workingDirectory, c.model, c.subAgent
683
683
  FROM conversations c
684
- WHERE c.claudeSessionId IS NOT NULL AND c.claudeSessionId != ''
685
- AND EXISTS (
684
+ WHERE EXISTS (
686
685
  SELECT 1 FROM sessions s
687
686
  WHERE s.conversationId = c.id
688
687
  AND s.status IN ('active', 'pending', 'interrupted')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.557",
3
+ "version": "1.0.559",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -2513,6 +2513,7 @@ class AgentGUIClient {
2513
2513
  const cachedHasActivity = cached.conversation.messageCount > 0 || this.state.streamingConversations.has(conversationId);
2514
2514
  this.applyAgentAndModelSelection(cached.conversation, cachedHasActivity);
2515
2515
  this.conversationCache.delete(conversationId);
2516
+ this.syncPromptState(conversationId);
2516
2517
  this.restoreScrollPosition(conversationId);
2517
2518
  this.enableControls();
2518
2519
  return;
@@ -2552,9 +2553,13 @@ class AgentGUIClient {
2552
2553
  const hasMoreChunks = totalChunks && chunks.length < totalChunks;
2553
2554
 
2554
2555
  const clientKnowsStreaming = this.state.streamingConversations.has(conversationId);
2555
- const shouldResumeStreaming = (isActivelyStreaming || clientKnowsStreaming) && latestSession &&
2556
+ const shouldResumeStreaming = latestSession &&
2556
2557
  (latestSession.status === 'active' || latestSession.status === 'pending');
2557
2558
 
2559
+ if (this.ui.messageInput) {
2560
+ this.ui.messageInput.disabled = shouldResumeStreaming;
2561
+ }
2562
+
2558
2563
  const outputEl = document.getElementById('output');
2559
2564
  if (outputEl) {
2560
2565
  const wdInfo = conversation.workingDirectory ? `${this.escapeHtml(conversation.workingDirectory)}` : '';
@@ -2726,13 +2731,9 @@ class AgentGUIClient {
2726
2731
  this.chunkPollState.lastFetchTimestamp = lastChunkTime;
2727
2732
  this.startChunkPolling(conversationId);
2728
2733
  this.disableControls();
2729
- // IMMUTABLE STATE: Prompt is disabled during active streaming, do NOT enable
2730
- if (this.ui.messageInput) this.ui.messageInput.disabled = true;
2734
+ this.syncPromptState(conversationId);
2731
2735
  } else {
2732
- // IMMUTABLE STATE: Prompt is enabled when NOT streaming (only disabled on WebSocket disconnect)
2733
- if (this.ui.messageInput && this.wsManager.isConnected) {
2734
- this.ui.messageInput.disabled = false;
2735
- }
2736
+ this.syncPromptState(conversationId);
2736
2737
  }
2737
2738
 
2738
2739
  this.restoreScrollPosition(conversationId);
@@ -2745,6 +2746,17 @@ class AgentGUIClient {
2745
2746
  }
2746
2747
  }
2747
2748
 
2749
+ syncPromptState(conversationId) {
2750
+ const isStreaming = this.state.streamingConversations.has(conversationId);
2751
+ if (this.ui.messageInput) {
2752
+ if (isStreaming) {
2753
+ this.ui.messageInput.disabled = true;
2754
+ } else {
2755
+ this.ui.messageInput.disabled = !this.wsManager.isConnected;
2756
+ }
2757
+ }
2758
+ }
2759
+
2748
2760
  removeScrollUpDetection() {
2749
2761
  const scrollContainer = document.getElementById(this.config.scrollContainerId);
2750
2762
  if (scrollContainer && this._scrollUpHandler) {