Skip to content

fix(cli): show reasoning without streaming - #34224

Draft
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-34209-cli-show-reasoning
Draft

fix(cli): show reasoning without streaming#34224
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-34209-cli-show-reasoning

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • make CLI show_reasoning work even when streaming: false by routing non-streaming reasoning through the preview callback
  • mark previewed reasoning as already shown so the final response path does not render a duplicate reasoning box
  • update CLI regression tests for non-streaming reasoning display selection and preview de-duplication

Closes #34209.

Verification

  • uv run --frozen pytest -q -o addopts='' tests/cli/test_reasoning_command.py -k 'ReasoningPreviewBuffering or ReasoningDisplayModeSelection'
  • uv run --frozen ruff check cli.py tests/cli/test_reasoning_command.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fix. Current main still returns no reasoning callback for show_reasoning=True with streaming_enabled=False (cli.py:5412-5418), while non-streaming assistant-message processing invokes a registered reasoning callback (agent/chat_completion_helpers.py:1060-1071). Routing this case to _on_reasoning therefore uses the existing buffered preview path (cli.py:9434-9439).

The added preview flag also aligns with the final-response guard at cli.py:12640-12642, preventing a rendered preview from being followed by a duplicate final reasoning box. The duplicate PR #34355 was closed in favor of this PR and explicitly noted that safeguard.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/streaming Streaming responses: gateway delivery, provider wire labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/streaming Streaming responses: gateway delivery, provider wire comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show_reasoning should work independently of streaming in CLI mode

3 participants