Skip to content

Conversation

@mmangkad
Copy link

This change adds support for handling the 'reasoning_content' field in streaming responses from custom OpenAI-compatible APIs, allowing models that return reasoning content in this field to display their chain of thought in Crush UI.

Previously, Crush only handled the 'reasoning' field but not the 'reasoning_content' field used by some custom servers.

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

This change adds support for handling the 'reasoning_content' field
in streaming responses from custom OpenAI-compatible APIs, allowing
models that return reasoning content in this field to display their
chain of thought in Crush UI.

Previously, Crush only handled the 'reasoning' field but not the
'reasoning_content' field used by some custom servers.
@mmangkad mmangkad requested a review from a team as a code owner October 24, 2025 01:29
@mmangkad mmangkad requested review from aymanbagabas and kujtimiihoxha and removed request for a team October 24, 2025 01:29
@charmcli
Copy link
Contributor

charmcli commented Oct 24, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mmangkad
Copy link
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

Jesssullivan added a commit to Jesssullivan/crush that referenced this pull request Oct 24, 2025
Integrates PR charmbracelet#1294 from @mmangkad to add support for reasoning_content
field in streaming responses from custom OpenAI-compatible servers.

This complements our existing non-streaming reasoning_content support,
providing full coverage for APIs like Z.AI GLM that use reasoning_content
instead of the standard reasoning field used by OpenAI o1 models.

Changes:
- Add streaming reasoning_content extraction in openai.go
- Emit EventThinkingDelta events for reasoning_content chunks
- Add clarifying comments distinguishing standard vs custom reasoning fields
- Maintain consistent error handling pattern with existing code

Credits: Based on PR charmbracelet#1294 by @mmangkad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants