fix(proxy): preserve reasoning_content for tool calls#2367
fix(proxy): preserve reasoning_content for tool calls#2367codeasier wants to merge 2 commits intofarion1231:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c288377e1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the review feedback in 160b587. The converter now only emits assistant messages when text/image content or tool_calls exist, so thinking-only blocks continue to be skipped instead of becoming empty assistant turns. Added |
Summary / 概述
Preserve assistant
thinkingblocks as OpenAI-compatiblereasoning_contentwhen converting Anthropic messages withtool_useinto Chat Completions format. Moonshot AI rejects assistant tool call history when thinking is enabled butreasoning_contentis missing, so this also injects a small fallback for tool call messages without thinking content.Related Issue / 关联 Issue
Fixes #2365
Screenshots / 截图
Before / 修改前



After / 修改后
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查 (not run; Rust-only change)pnpm format:checkpasses / 通过代码格式检查 (not run;cargo fmt --checkpassed)cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)Verification / 验证
cargo fmt --checkcargo clippy --lib -- -D warningscargo test --lib transform