This commit is contained in:
Colin McDonnell
2025-12-17 12:26:07 -08:00
parent def7ee0303
commit 479e066492
5 changed files with 10 additions and 17 deletions
+3 -5
View File
@@ -91299,7 +91299,6 @@ var opencode = agent({
const startTime = Date.now();
let lastActivityTime = startTime;
let eventCount = 0;
let stdoutBuffer = "";
let output = "";
const result = await spawn4({
cmd: cliPath,
@@ -91310,11 +91309,11 @@ var opencode = agent({
// 10 minutes timeout to prevent infinite hangs
stdio: ["ignore", "pipe", "pipe"],
onStdout: async (chunk) => {
const parsed2 = JSON.parse(chunk);
log.debug(JSON.stringify(parsed2, null, 2));
const text = chunk.toString();
output += text;
stdoutBuffer += text;
const lines = stdoutBuffer.split("\n");
stdoutBuffer = lines.pop() || "";
const lines = text.split("\n");
for (const line of lines) {
const trimmed = line.trim();
if (!trimmed) {
@@ -91322,7 +91321,6 @@ var opencode = agent({
}
try {
const event = JSON.parse(trimmed);
log.debug(JSON.stringify(event, null, 2));
eventCount++;
const timeSinceLastActivity = Date.now() - lastActivityTime;
if (timeSinceLastActivity > 1e4) {