agentgui 1.0.556 → 1.0.558

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
@@ -676,8 +676,16 @@ export const queries = {
676
676
  },
677
677
 
678
678
  getResumableConversations() {
679
+ // Get conversations with active/pending sessions that can be resumed
680
+ // Check sessions table directly for actual active status, don't filter by claudeSessionId
679
681
  const stmt = prep(
680
- "SELECT id, title, claudeSessionId, agentId, agentType, workingDirectory, model, subAgent FROM conversations WHERE isStreaming = 1 AND claudeSessionId IS NOT NULL AND claudeSessionId != ''"
682
+ `SELECT DISTINCT c.id, c.title, c.claudeSessionId, c.agentId, c.agentType, c.workingDirectory, c.model, c.subAgent
683
+ FROM conversations c
684
+ WHERE EXISTS (
685
+ SELECT 1 FROM sessions s
686
+ WHERE s.conversationId = c.id
687
+ AND s.status IN ('active', 'pending', 'interrupted')
688
+ )`
681
689
  );
682
690
  return stmt.all();
683
691
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.556",
3
+ "version": "1.0.558",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -2474,7 +2474,8 @@ class AgentGUIClient {
2474
2474
  if (this.ui.messageInput) {
2475
2475
  this.ui.messageInput.value = '';
2476
2476
  this.ui.messageInput.style.height = 'auto';
2477
- this.ui.messageInput.disabled = false;
2477
+ // Note: prompt disabled state will be set immutably based on shouldResumeStreaming
2478
+ // after conversation data loads, don't set here
2478
2479
  }
2479
2480
 
2480
2481
  if (this.ui.stopButton) this.ui.stopButton.classList.remove('visible');
@@ -2512,6 +2513,7 @@ class AgentGUIClient {
2512
2513
  const cachedHasActivity = cached.conversation.messageCount > 0 || this.state.streamingConversations.has(conversationId);
2513
2514
  this.applyAgentAndModelSelection(cached.conversation, cachedHasActivity);
2514
2515
  this.conversationCache.delete(conversationId);
2516
+ this.syncPromptState(conversationId);
2515
2517
  this.restoreScrollPosition(conversationId);
2516
2518
  this.enableControls();
2517
2519
  return;
@@ -2725,6 +2727,9 @@ class AgentGUIClient {
2725
2727
  this.chunkPollState.lastFetchTimestamp = lastChunkTime;
2726
2728
  this.startChunkPolling(conversationId);
2727
2729
  this.disableControls();
2730
+ this.syncPromptState(conversationId);
2731
+ } else {
2732
+ this.syncPromptState(conversationId);
2728
2733
  }
2729
2734
 
2730
2735
  this.restoreScrollPosition(conversationId);
@@ -2737,6 +2742,17 @@ class AgentGUIClient {
2737
2742
  }
2738
2743
  }
2739
2744
 
2745
+ syncPromptState(conversationId) {
2746
+ const isStreaming = this.state.streamingConversations.has(conversationId);
2747
+ if (this.ui.messageInput) {
2748
+ if (isStreaming) {
2749
+ this.ui.messageInput.disabled = true;
2750
+ } else {
2751
+ this.ui.messageInput.disabled = !this.wsManager.isConnected;
2752
+ }
2753
+ }
2754
+ }
2755
+
2740
2756
  removeScrollUpDetection() {
2741
2757
  const scrollContainer = document.getElementById(this.config.scrollContainerId);
2742
2758
  if (scrollContainer && this._scrollUpHandler) {