Fix MiniMax chat tool compatibility#77
Open
skyan wants to merge 5 commits into
Open
Conversation
[codex] fix MiniMax chat tool compatibility
[codex] Fix Responses stream passthrough tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
对于MiniMax这样的大模型而言,有些API兼容性问题需要解决,否则codex无法使用:
MiniMax 当前在函数工具省略 parameters 时会拒绝请求,返回 invalid params, 400 (2013)。此外,它会把 reasoning 内容放在 标签中,并作为普通 Chat content 输出;如果不处理,这些内容会泄漏到 Codex 可见的输出文本中。
我也直接针对 /v1/chat/completions 验证了原始 MiniMax 的 stream=true + tools 请求;当前它会返回 HTTP 200,并通过流式 tool_calls delta 输出工具调用。因此,这个 PR 没有为该路径增加非流式 fallback。
验证
go test ./internal/protocol/chat ./internal/protocol/openai ./internal/service/server ./internal/config原始 MiniMax 端点验证:
通过临时本地实例验证 Moon Bridge: