Flesh out debug logs

This commit is contained in:
Colin McDonnell
2025-12-17 13:11:44 -08:00
parent bd932e7696
commit 1f1c1602c5
9 changed files with 57 additions and 54 deletions
+3 -5
View File
@@ -30,7 +30,7 @@ export const opencode = agent({
configureOpenCode({ mcpServers, sandbox: payload.sandbox ?? false });
const prompt = addInstructions({ payload, prepResults, repo });
log.group("Full prompt", () => log.info(prompt));
log.group("» Full prompt", () => log.info(prompt));
// message positional must come right after "run", before flags
const args = ["run", prompt, "--format", "json"];
@@ -105,9 +105,7 @@ export const opencode = agent({
eventCount++;
// debug log all events to diagnose ordering and missing MCP/bash tool calls
log.debug(
`» event: type=${event.type} data=${JSON.stringify(event).substring(0, 300)}`
);
log.debug(JSON.stringify(event, null, 2));
const timeSinceLastActivity = Date.now() - lastActivityTime;
if (timeSinceLastActivity > 10000) {
@@ -253,7 +251,7 @@ function configureOpenCode({ mcpServers, sandbox }: ConfigureOpenCodeParams): vo
throw error;
}
log.info(`OpenCode config written to ${configPath} (sandbox: ${sandbox})`);
log.info(`» OpenCode config written to ${configPath} (sandbox: ${sandbox})`);
log.debug(`OpenCode config contents:\n${configJson}`);
}