summaryrefslogtreecommitdiff
path: root/packages/cli/src/nonInteractiveCli.ts
diff options
context:
space:
mode:
authorAllen Hutchison <[email protected]>2025-06-18 11:40:15 -0700
committerGitHub <[email protected]>2025-06-18 11:40:15 -0700
commitfbc79c34c9eb05dcefa4618a6863360ec2b46277 (patch)
tree724cec98a05f58eff4cc7b79ba1cfb8f02c6d55d /packages/cli/src/nonInteractiveCli.ts
parent589a7b59c61f0477196ff3c4eec59418367387b4 (diff)
Fix noise in headless mode on STDOUT (#1184)
Diffstat (limited to 'packages/cli/src/nonInteractiveCli.ts')
-rw-r--r--packages/cli/src/nonInteractiveCli.ts5
1 files changed, 5 insertions, 0 deletions
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)