This commit is contained in:
Colin McDonnell
2025-12-17 11:37:05 -08:00
parent 9cc1e7b689
commit 02ce90556f
3 changed files with 15 additions and 7 deletions
+6 -3
View File
@@ -89578,6 +89578,7 @@ function formatPrepResults(results) {
function buildRuntimeContext({ repo, prepResults }) {
const lines = [];
lines.push(`working_directory: ${process.cwd()}`);
lines.push(`log_level: ${process.env.LOG_LEVEL}`);
try {
const gitStatus = execSync("git status --short", { encoding: "utf-8", stdio: "pipe" }).trim();
lines.push(`git_status: ${gitStatus || "(clean)"}`);
@@ -91298,6 +91299,7 @@ var opencode = agent({
const startTime = Date.now();
let lastActivityTime = startTime;
let eventCount = 0;
let stdoutBuffer = "";
let output = "";
const result = await spawn4({
cmd: cliPath,
@@ -91308,11 +91310,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;
const lines = text.split("\n");
stdoutBuffer += text;
const lines = stdoutBuffer.split("\n");
stdoutBuffer = lines.pop() || "";
for (const line of lines) {
const trimmed = line.trim();
if (!trimmed) {
@@ -91320,6 +91322,7 @@ 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) {