Skip to content

fix: align reasoning field name in request & response#155

Merged
BugenZhao merged 4 commits intomainfrom
bz/top-swordtail
May 5, 2026
Merged

fix: align reasoning field name in request & response#155
BugenZhao merged 4 commits intomainfrom
bz/top-swordtail

Conversation

@BugenZhao
Copy link
Copy Markdown
Member

Currently it's reasoning_content in the request schema and reasoning in the response schema, so it cannot survive any multi-turn conversation!

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request renames the reasoning_content field to reasoning in the ChatMessage enum and adds a serde alias to maintain backward compatibility. It also updates the conversion logic and unit tests to reflect this change, including a new test case for the legacy alias. The reviewer suggests reverting the primary field name to reasoning_content to maintain alignment with the OpenAI API standard, while using reasoning as the alias instead.

Comment thread src/server/src/routes/openai/utils/types.rs
Comment thread src/server/src/routes/openai/chat_completions/convert.rs
BugenZhao added 2 commits May 5, 2026 19:40
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao enabled auto-merge (squash) May 5, 2026 11:41
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao merged commit e618877 into main May 5, 2026
3 checks passed
@BugenZhao BugenZhao deleted the bz/top-swordtail branch May 5, 2026 11:44
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.

1 participant