Skip to content

fix(server): pin the Claude CLI verbose setting for text generation - #7735

Open
sti0 wants to merge 1 commit into
pingdotgg:mainfrom
sti0:fix/claude-cli-verbose-pin
Open

fix(server): pin the Claude CLI verbose setting for text generation#7735
sti0 wants to merge 1 commit into
pingdotgg:mainfrom
sti0:fix/claude-cli-verbose-pin

Conversation

@sti0

@sti0 sti0 commented Aug 20, 2026

Copy link
Copy Markdown

What Changed

makeClaudeTextGeneration now always sets verbose: false in the settings object it passes to --settings. Because the key is always present, the --settings payload now goes out on every call instead of only when thinking, fastMode or ultracode are set. Those three are otherwise untouched.

Tests: a new case for the pinned --settings {"verbose":false} with no other settings, a new case proving that streamed events fail loudly, and the existing fixtures' --settings expectations extended by verbose.

Three added lines of production code, the rest is tests.

Why

Text generation through the Claude CLI fails silently whenever the user has verbose enabled in their Claude settings. With verbose on, claude -p --output-format json prints an array of stream events instead of the flat { structured_output } envelope the decoder expects, so decoding dies with SchemaError: Expected object, wrapped in TextGenerationError: Claude CLI returned unexpected output format.

That error is only ever swallowed as a log warning, so nothing surfaces to the user. Thread titles, worktree branch names, commit messages and PR bodies just keep falling back to their placeholders (t3code/<hex>), permanently, with no indication why.

Pinning the setting is enough — no tolerant parsing of the event array is needed. Measured against Claude CLI 2.1.233, --settings beats both the user-level and the project-level settings:

call (user + project verbose: true) output
without --settings [{"type":"system",… — array
with --settings {"verbose":false} {"is_error":false,… — flat object

The second test holds that assumption in place: if the CLI ever streams events despite the pinned setting, it fails loudly instead of silently.

Other providers are unaffected — Codex, Cursor, Grok and OpenCode parse the response text straight against the output schema, without an envelope.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes — no UI changes
  • I included a video for animation/interaction changes — no motion changes

Claude Opus 5 via Claude Code.

Created with AI assistance (Claude), reviewed by Timo.


Note

Low Risk
Small, localized CLI settings override for Claude text generation only; no auth, data, or provider-contract changes.

Overview
Stops Claude text generation from breaking when the user has CLI verbose enabled. User-level verbose made claude -p --output-format json emit a stream-event array instead of the { structured_output } envelope, so titles, branch names, commit messages, and PR bodies silently fell back to placeholders.

runClaudeJson now always includes verbose: false in --settings, so that flag is sent on every Claude CLI call (not only when thinking/fastMode/ultracode are set). Tests cover the always-on settings payload and fail loudly if the CLI still streams events.

Reviewed by Cursor Bugbot for commit 44a4a61. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Pin verbose:false in Claude CLI --settings for text generation

  • ClaudeTextGeneration.ts now unconditionally sets verbose:false in the settings object before merging optional flags, so --settings is always passed to the Claude CLI.
  • Updates existing tests to expect verbose:false in the settings JSON and adds a new test verifying --settings {"verbose":false} is sent even when no other settings are specified.
  • Adds a test asserting that stream-event CLI output fails with a TextGenerationError containing 'unexpected output format'.
  • Behavioral Change: all Claude CLI invocations from text generation now include --settings with at least {"verbose":false}, whereas previously --settings could be omitted when no optional flags were set.

Macroscope summarized 44a4a61.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dff14a5e-e078-4179-a3d5-2437837f4d1b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 20, 2026
Text generation through the Claude CLI failed silently whenever a
user- or project-level `verbose` setting was enabled: `claude -p
--output-format json` then prints an array of stream events instead of
the flat `{ structured_output }` envelope the decoder expects. The
resulting `SchemaError` was swallowed as a log warning, so thread
titles, worktree branch names, commit messages and PR bodies fell back
to their placeholders (`t3code/<hex>`) forever.

`settings` now always carries `verbose: false`, which also means the
`--settings` payload goes out on every call instead of only when
thinking, fastMode or ultracode are set. Measured against Claude CLI
2.1.233, `--settings` beats both user and project settings, so no
tolerant parsing of the event array is needed. A test pins the
assumption: streamed events must fail loudly.
@sti0
sti0 force-pushed the fix/claude-cli-verbose-pin branch from f581de8 to 44a4a61 Compare August 20, 2026 23:35
@macroscopeapp

macroscopeapp Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f581de8

Macroscope's review found this PR approvable — Small defensive bug fix that pins verbose: false to prevent user-level CLI configuration from breaking JSON output parsing. The 3-line production change is well-tested with new test cases covering both the fix and failure detection.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants