agentgui 1.0.661 → 1.0.663
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 +5 -2
- package/package.json +1 -1
- package/static/js/client.js +25 -0
package/lib/claude-runner.js
CHANGED
|
@@ -114,6 +114,7 @@ class AgentRunner {
|
|
|
114
114
|
let retryAfterSec = 60;
|
|
115
115
|
let authError = false;
|
|
116
116
|
let authErrorMessage = '';
|
|
117
|
+
let stderrBuffer = '';
|
|
117
118
|
|
|
118
119
|
const timeoutHandle = setTimeout(() => {
|
|
119
120
|
timedOut = true;
|
|
@@ -158,6 +159,7 @@ class AgentRunner {
|
|
|
158
159
|
|
|
159
160
|
if (proc.stderr) proc.stderr.on('data', (chunk) => {
|
|
160
161
|
const errorText = chunk.toString();
|
|
162
|
+
stderrBuffer += errorText;
|
|
161
163
|
console.error(`[${this.id}] stderr:`, errorText);
|
|
162
164
|
|
|
163
165
|
const authMatch = errorText.match(/401|unauthorized|invalid.*auth|invalid.*token|auth.*failed|permission denied|access denied/i);
|
|
@@ -242,7 +244,8 @@ class AgentRunner {
|
|
|
242
244
|
if (code === 0 || outputs.length > 0) {
|
|
243
245
|
resolve({ outputs, sessionId });
|
|
244
246
|
} else {
|
|
245
|
-
|
|
247
|
+
const stderrHint = stderrBuffer.trim() ? `: ${stderrBuffer.trim().slice(0, 200)}` : '';
|
|
248
|
+
reject(new Error(`${this.name} exited with code ${code}${stderrHint}`));
|
|
246
249
|
}
|
|
247
250
|
});
|
|
248
251
|
|
|
@@ -617,7 +620,7 @@ registry.register({
|
|
|
617
620
|
closeStdin: false, // keep stdin open for JSON-RPC steering commands
|
|
618
621
|
useJsonRpcStdin: false,
|
|
619
622
|
supportedFeatures: ['streaming', 'resume', 'system-prompt', 'permissions-skip', 'steering'],
|
|
620
|
-
spawnEnv: { MAX_THINKING_TOKENS: '0' },
|
|
623
|
+
spawnEnv: { MAX_THINKING_TOKENS: '0', AGENTGUI_SUBPROCESS: '1' },
|
|
621
624
|
|
|
622
625
|
buildArgs(prompt, config) {
|
|
623
626
|
const {
|
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -1156,6 +1156,16 @@ class AgentGUIClient {
|
|
|
1156
1156
|
if (indicator) {
|
|
1157
1157
|
indicator.innerHTML = `<span style="color:var(--color-error);">Error: ${this.escapeHtml(data.error || 'Unknown error')}</span>`;
|
|
1158
1158
|
}
|
|
1159
|
+
} else {
|
|
1160
|
+
const outputEl3 = document.getElementById('output');
|
|
1161
|
+
const messagesEl3 = outputEl3 && outputEl3.querySelector('.conversation-messages');
|
|
1162
|
+
if (messagesEl3 && data.error) {
|
|
1163
|
+
const errDiv = document.createElement('div');
|
|
1164
|
+
errDiv.className = 'message';
|
|
1165
|
+
errDiv.style = 'padding:0.75rem;border:1px solid var(--color-error, #e53e3e);border-radius:4px;margin:0.5rem 0;';
|
|
1166
|
+
errDiv.innerHTML = `<span style="color:var(--color-error, #e53e3e);">Error: ${this.escapeHtml(data.error)}</span>`;
|
|
1167
|
+
messagesEl3.appendChild(errDiv);
|
|
1168
|
+
}
|
|
1159
1169
|
}
|
|
1160
1170
|
|
|
1161
1171
|
this.unlockAgentAndModel();
|
|
@@ -2891,6 +2901,21 @@ class AgentGUIClient {
|
|
|
2891
2901
|
messagesEl.appendChild(this.renderMessagesFragment(allMessages || []));
|
|
2892
2902
|
}
|
|
2893
2903
|
|
|
2904
|
+
if (shouldResumeStreaming && latestSession && chunks.length === 0) {
|
|
2905
|
+
const streamDiv = document.createElement('div');
|
|
2906
|
+
streamDiv.id = `streaming-${latestSession.id}`;
|
|
2907
|
+
streamDiv.className = 'streaming-message';
|
|
2908
|
+
const indicatorDiv = document.createElement('div');
|
|
2909
|
+
indicatorDiv.className = 'streaming-indicator';
|
|
2910
|
+
indicatorDiv.style = 'display:flex;align-items:center;gap:0.5rem;padding:0.5rem 0;color:var(--color-text-secondary);font-size:0.875rem;';
|
|
2911
|
+
indicatorDiv.innerHTML = `
|
|
2912
|
+
<span class="animate-spin" style="display:inline-block;width:1rem;height:1rem;border:2px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;"></span>
|
|
2913
|
+
<span class="streaming-indicator-label">Agent is starting...</span>
|
|
2914
|
+
`;
|
|
2915
|
+
streamDiv.appendChild(indicatorDiv);
|
|
2916
|
+
messagesEl.appendChild(streamDiv);
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2894
2919
|
if (shouldResumeStreaming && latestSession) {
|
|
2895
2920
|
this.state.streamingConversations.set(conversationId, true);
|
|
2896
2921
|
this.state.currentSession = {
|