agentgui 1.0.642 → 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/lib/claude-runner.js +6 -6
- package/package.json +1 -1
- package/static/js/client.js +15 -4
package/lib/claude-runner.js
CHANGED
|
@@ -609,10 +609,10 @@ registry.register({
|
|
|
609
609
|
name: 'Claude Code',
|
|
610
610
|
command: 'claude',
|
|
611
611
|
protocol: 'direct',
|
|
612
|
-
supportsStdin:
|
|
613
|
-
closeStdin:
|
|
614
|
-
useJsonRpcStdin:
|
|
615
|
-
supportedFeatures: ['streaming', 'resume', 'system-prompt', 'permissions-skip'],
|
|
612
|
+
supportsStdin: true, // keep open for steering via JSON-RPC
|
|
613
|
+
closeStdin: false, // must NOT close stdin to allow steering prompts
|
|
614
|
+
useJsonRpcStdin: true, // support JSON-RPC steering input
|
|
615
|
+
supportedFeatures: ['streaming', 'resume', 'system-prompt', 'permissions-skip', 'steering'],
|
|
616
616
|
spawnEnv: { MAX_THINKING_TOKENS: '0' },
|
|
617
617
|
|
|
618
618
|
buildArgs(prompt, config) {
|
|
@@ -633,8 +633,8 @@ registry.register({
|
|
|
633
633
|
if (model) flags.push('--model', model);
|
|
634
634
|
if (resumeSessionId) flags.push('--resume', resumeSessionId);
|
|
635
635
|
if (systemPrompt) flags.push('--append-system-prompt', systemPrompt);
|
|
636
|
-
//
|
|
637
|
-
|
|
636
|
+
// Do NOT pass prompt as positional arg - send via stdin instead to allow steering
|
|
637
|
+
// This allows stdin to stay open for receiving JSON-RPC steering commands
|
|
638
638
|
|
|
639
639
|
return flags;
|
|
640
640
|
},
|
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|