diff options
| author | Allen Hutchison <[email protected]> | 2025-06-18 11:40:15 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-18 11:40:15 -0700 |
| commit | fbc79c34c9eb05dcefa4618a6863360ec2b46277 (patch) | |
| tree | 724cec98a05f58eff4cc7b79ba1cfb8f02c6d55d /packages/cli/src | |
| parent | 589a7b59c61f0477196ff3c4eec59418367387b4 (diff) | |
Fix noise in headless mode on STDOUT (#1184)
Diffstat (limited to 'packages/cli/src')
| -rw-r--r-- | packages/cli/src/gemini.tsx | 2 | ||||
| -rw-r--r-- | packages/cli/src/nonInteractiveCli.ts | 5 | ||||
| -rw-r--r-- | packages/cli/src/utils/sandbox.ts | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx index 148f18bf..d87a8a6a 100644 --- a/packages/cli/src/gemini.tsx +++ b/packages/cli/src/gemini.tsx @@ -30,7 +30,6 @@ import { export async function main() { const workspaceRoot = process.cwd(); const settings = loadSettings(workspaceRoot); - setWindowTitle(basename(workspaceRoot), settings); await cleanupCheckpoints(); if (settings.errors.length > 0) { @@ -84,6 +83,7 @@ export async function main() { // Render UI, passing necessary config values. Check that there is no command line question. if (process.stdin.isTTY && input?.length === 0) { + setWindowTitle(basename(workspaceRoot), settings); render( <React.StrictMode> <AppWrapper diff --git a/packages/cli/src/nonInteractiveCli.ts b/packages/cli/src/nonInteractiveCli.ts index 3efb8452..c5a89575 100644 --- a/packages/cli/src/nonInteractiveCli.ts +++ b/packages/cli/src/nonInteractiveCli.ts @@ -27,6 +27,11 @@ function getResponseText(response: GenerateContentResponse): string | null { candidate.content.parts && candidate.content.parts.length > 0 ) { + // We are running in headless mode so we don't need to return thoughts to STDOUT. + const thoughtPart = candidate.content.parts[0]; + if (thoughtPart?.thought) { + return null; + } return candidate.content.parts .filter((part) => part.text) .map((part) => part.text) diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index 9e9ab1a7..48386357 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -203,6 +203,7 @@ export async function start_sandbox(config: SandboxConfig) { ); process.exit(1); } + // Log on STDERR so it doesn't clutter the output on STDOUT console.error(`using macos seatbelt (profile: ${profile}) ...`); // if DEBUG is set, convert to --inspect-brk in NODE_OPTIONS const args = [ |
