From 114c0b5632f01b8445c26abf2a8846c0e5f9d793 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Tue, 16 Dec 2025 18:55:05 -0800 Subject: [PATCH] Clean up log.group --- agents/claude.ts | 2 +- agents/cursor.ts | 1 + agents/gemini.ts | 2 +- agents/opencode.ts | 1 + utils/cli.ts | 9 +++++++++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/agents/claude.ts b/agents/claude.ts index 72a0cf8..fa1c942 100644 --- a/agents/claude.ts +++ b/agents/claude.ts @@ -19,7 +19,7 @@ export const claude = agent({ delete process.env.ANTHROPIC_API_KEY; const prompt = addInstructions({ payload, prepResults, repo }); - console.log(prompt); + log.group("Full prompt", (log) => log.info(prompt)); // configure sandbox mode if enabled const sandboxOptions: Options = payload.sandbox diff --git a/agents/cursor.ts b/agents/cursor.ts index 02bd6d0..b7af0c5 100644 --- a/agents/cursor.ts +++ b/agents/cursor.ts @@ -167,6 +167,7 @@ export const cursor = agent({ try { const fullPrompt = addInstructions({ payload, prepResults, repo }); + log.group("Full prompt", (log) => log.info(fullPrompt)); // configure sandbox mode if enabled // in sandbox mode: remove --force flag and rely on cli-config.json sandbox settings diff --git a/agents/gemini.ts b/agents/gemini.ts index f07223b..c14bc0d 100644 --- a/agents/gemini.ts +++ b/agents/gemini.ts @@ -162,7 +162,7 @@ export const gemini = agent({ } const sessionPrompt = addInstructions({ payload, prepResults, repo }); - log.info(`Starting Gemini CLI with prompt: ${payload.prompt.substring(0, 100)}...`); + log.group("Full prompt", (log) => log.info(sessionPrompt)); // configure sandbox mode if enabled // --allowed-tools restricts which tools are available (removes others from registry entirely) diff --git a/agents/opencode.ts b/agents/opencode.ts index 8c6d13a..fa5f309 100644 --- a/agents/opencode.ts +++ b/agents/opencode.ts @@ -314,6 +314,7 @@ export const opencode = agent({ configureOpenCodeSandbox({ sandbox: payload.sandbox ?? false }); const prompt = addInstructions({ payload, prepResults, repo }); + log.group("Full prompt", (log) => log.info(prompt)); const args = ["run", "--format", "json", prompt]; if (payload.sandbox) { diff --git a/utils/cli.ts b/utils/cli.ts index 9fcc470..41f1c9f 100644 --- a/utils/cli.ts +++ b/utils/cli.ts @@ -316,6 +316,15 @@ export const log = { */ endGroup, + /** + * Run a callback within a collapsed group + */ + group: (name: string, fn: (log: typeof log) => void): void => { + startGroup(name); + fn(log); + endGroup(); + }, + /** * Log tool call information to console with formatted output */