Skip to content

fix: preserve reasoning content in chat history - #999

Open
BaygeldiAza wants to merge 1 commit into
dataelement:mainfrom
BaygeldiAza:fix/reasoning-content-570
Open

fix: preserve reasoning content in chat history#999
BaygeldiAza wants to merge 1 commit into
dataelement:mainfrom
BaygeldiAza:fix/reasoning-content-570

Conversation

@BaygeldiAza

Copy link
Copy Markdown

Summary

This PR fixes an issue where assistant reasoning stored in ChatMessage.thinking was reconstructed using the wrong field name.

When chat history was rebuilt, the reasoning was sent as thinking instead of reasoning_content, which could cause thinking-mode requests to fail.

Type of change

  • Bug fix
  • New feature
  • Refactor / chore
  • Documentation

Changes

  • Preserve assistant reasoning as reasoning_content when rebuilding chat history
  • Only include reasoning_content for assistant messages
  • Add a regression test for the history conversion

Testing

  • Added test_convert_chat_messages_preserves_reasoning_content
  • Relevant LLM tests pass locally
  • Backend test suite passes locally

Related issue

Fixes #570

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.

[Bug] Thinking Mode: reasoning_content must be passed back to API

1 participant