Skip to content

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

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

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, targeted change to Claude CLI invocation flags for text generation; no auth, data, or cross-provider behavior changes.

Overview
Claude text generation now always passes --settings with verbose: false when invoking the Claude CLI, so user or project verbose settings cannot make the CLI return a stream-event JSON array instead of the single { structured_output } envelope the server parses.

Because verbose is always present in the settings object, --settings is sent on every Claude text-generation call, not only when thinking, fast mode, or ultracode flags are set. Existing tests were updated to expect verbose:false alongside those flags.

New tests cover the minimal --settings {"verbose":false} case and assert that stream-style CLI output surfaces a TextGenerationError with an unexpected output format message instead of failing silently and falling back to placeholders.

Reviewed by Cursor Bugbot for commit a4ab429. 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 a4ab429.

@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: 2ebf46f7-0dbb-44b3-918b-a685be9fa1ec

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

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
@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.

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 44a4a61 to a4ab429 Compare August 28, 2026 22:48
@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by #10446, which landed on main.

That PR fixes the same Claude verbose-mode text-generation failure by accepting either CLI output shape and reading structured_output from the last result message, instead of pinning verbose: false. Closing this as superseded — please reopen if anything here is still needed beyond that.

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.

3 participants