Skip to content

fix(cli): handle Reasoning content and fix streaming thinking display#7296

Merged
DOsinga merged 1 commit intoblock:mainfrom
rabi:fix_reasoning_display
Feb 18, 2026
Merged

fix(cli): handle Reasoning content and fix streaming thinking display#7296
DOsinga merged 1 commit intoblock:mainfrom
rabi:fix_reasoning_display

Conversation

@rabi
Copy link
Contributor

@rabi rabi commented Feb 18, 2026

Summary

Add MessageContent::Reasoning to both CLI renderers. Fix streaming to print a single "Thinking:" header then stream dimmed text, instead of repeating the header per chunk.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Tested locally.

Add MessageContent::Reasoning to both CLI renderers. Fix streaming
to print a single "Thinking:" header then stream dimmed text, instead
of repeating the header per chunk.

Change-Id: I52cd5d567aa758a4b630d28fba235395913bb61c
Signed-off-by: rabi <ramishra@redhat.com>
theme: Theme,
) {
if should_show_thinking() {
flush_markdown_buffer(buffer, theme);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably this doesn't happen half way rendering of markdown? not that we could do much about it

@DOsinga DOsinga added this pull request to the merge queue Feb 18, 2026
Merged via the queue into block:main with commit f481484 Feb 18, 2026
19 checks passed
jh-block added a commit that referenced this pull request Feb 18, 2026
* origin/main:
  docs: remove ALPHA_FEATURES flag from documentation (#7315)
  docs: escape variable syntax in recipes (#7314)
  docs: update OTel environment variable and config guides (#7221)
  docs: system proxy settings (#7311)
  docs: add Summon extension tutorial and update Skills references (#7310)
  docs: agent session id (#7289)
  fix(gemini-cli): restore streaming lost in #7247 (#7291)
  Update more instructions (#7305)
  feat: add Moonshot and Kimi Code declarative providers (#7304)
  fix(cli): handle Reasoning content and fix streaming thinking display (#7296)
  feat: add GOOSE_SUBAGENT_MODEL and GOOSE_SUBAGENT_PROVIDER config options (#7277)
  fix(openai): support "reasoning" field alias in streaming deltas (#7294)
  fix(ui): revert app-driven iframe width and send containerDimensions per ext-apps spec (#7300)
  New OpenAI event (#7301)
  ci: add fork guards to scheduled workflows (#7292)
michaelneale added a commit that referenced this pull request Feb 19, 2026
* main: (54 commits)
  docs: add monitoring subagent activity section (#7323)
  docs: document Desktop UI recipe editing for model/provider and extensions (#7327)
  docs: add CLAUDE_THINKING_BUDGET and CLAUDE_THINKING_ENABLED environm… (#7330)
  fix: display 'Code Mode' instead of 'code_execution' in CLI (#7321)
  docs: add Permission Policy documentation for MCP Apps (#7325)
  update RPI plan prompt (#7326)
  docs: add CLI syntax highlighting theme customization (#7324)
  fix(cli): replace shell-based update with native Rust implementation (#7148)
  docs: rename Code Execution extension to Code Mode extension (#7316)
  docs: remove ALPHA_FEATURES flag from documentation (#7315)
  docs: escape variable syntax in recipes (#7314)
  docs: update OTel environment variable and config guides (#7221)
  docs: system proxy settings (#7311)
  docs: add Summon extension tutorial and update Skills references (#7310)
  docs: agent session id (#7289)
  fix(gemini-cli): restore streaming lost in #7247 (#7291)
  Update more instructions (#7305)
  feat: add Moonshot and Kimi Code declarative providers (#7304)
  fix(cli): handle Reasoning content and fix streaming thinking display (#7296)
  feat: add GOOSE_SUBAGENT_MODEL and GOOSE_SUBAGENT_PROVIDER config options (#7277)
  ...
michaelneale added a commit that referenced this pull request Feb 19, 2026
…7302)

The catch-all match arm in render_message() and render_message_streaming()
printed 'WARNING: Message content type could not be rendered' to stdout
via println!. This pollutes stdout when piping or scripting (e.g. with
--quiet --text), breaking CI pipelines that expect only model output on
stdout.

Changes:
- Replace println! with eprintln! so the warning goes to stderr, following
  the POSIX convention that stdout is for program output and stderr is for
  diagnostics/warnings.
- Replace the wildcard (_ =>) match arms with explicit matches for
  ToolConfirmationRequest and FrontendToolRequest. This ensures that if a
  new MessageContent variant is added in the future, the compiler will
  flag the missing match arm instead of silently falling through.

Note: The primary cause of #7302 (ReasoningContent not being handled,
causing a flood of warnings) was already fixed by commit f481484
(PR #7296). This commit addresses the secondary concern from the issue:
warnings should never be printed to stdout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments