🔖 Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/stream-chain.js

This commit is contained in:
rUv committed 2025-08-12 18:50:40 +00:00
1 parent c363f1207c
commit e444d8b48d
3 files changed
+5 -6

No files matched your search

+1
View File
@@ -0,0 +1 @@
{"branch": "checkpoint/pre-edit-20250812-184923", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/stream-chain.js", "timestamp": "2025-08-12T18:49:23Z", "type": "pre-edit", "original_branch": "alpha-89"}
+1
View File
@@ -0,0 +1 @@
{"tag": "checkpoint-20250812-184925", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/stream-chain.js", "timestamp": "2025-08-12T18:49:25Z", "type": "post-edit", "branch": "alpha-89", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 490 ++++++++++++++++++++++++++++--- .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1755024546.json | 1 + .claude/checkpoints/1755024548.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/stream-chain.js | 39 ++- 7 files changed, 499 insertions(+), 40 deletions(-) "}
+3 -6
View File
@@ -390,24 +390,21 @@ async function executeStreamStep(prompt, inputStream, isLast, flags = {}) {
console.log(` Debug: Executing: claude ${args.join(' ')}`);
}
// Try exec instead of spawn for better compatibility
// Use exec with built-in timeout for better reliability
const command = `claude ${args.join(' ')}`;
exec(command, {
timeout: stepTimeout,
maxBuffer: 1024 * 1024 * 10 // 10MB buffer
}, (error, stdout, stderr) => {
clearTimeout(timeoutId);
if (timedOut) {
return; // Already handled by timeout
if (resolved) {
return; // Already resolved
}
const duration = Date.now() - startTime;
if (error && error.code === 'TIMEOUT') {
// Handle timeout via exec
timedOut = true;
console.log('⚠️ Claude CLI timed out, falling back to mock mode...');
mockStreamStep(prompt, inputStream, isLast, { ...flags, mock: true }, safeResolve, Date.now());
return;