Open
Conversation
Owner
|
多谢 @sandleft 推到这条边界,Codex Responses 的 tool 路径以前没人压过。 读完一遍发现一个会让 custom / web_search / namespace 回转识别失效的点:
另外 namespace 直接拼接,如果两个 namespace 下有同名 tool 会撞,建议加个分隔符或者拼之前先 dedupe。 286 行改动 + 0 测试也是合并卡点。能再补一轮 metadata 透传修复 + Responses native tool 的最小测试用例吗?格式跟 PR 留 open 等你这一版。 |
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.
改动
在
src/handlers/responses.js中补充了对 Codex Responses API 工具类型的兼容处理,修复代理此前直接拒绝部分工具定义的问题。这次兼容/转换的工具类型包括:
customnamespaceweb_searchtool_search此外,这次改动还保留了 namespace 相关的工具命名信息,使 Codex 的本地工具调用可以通过这个 OpenAI 兼容代理正确映射,而不是在请求解析阶段直接失败。
为什么
较新的 Codex 默认使用 Responses API,请求里可能会带一些不属于传统 OpenAI
functiontool 形态的工具定义。在这个改动之前,WindsurfAPI 会直接报错,例如:
Unsupported Responses tool type: customUnsupported Responses tool type: web_searchUnsupported Responses tool type: namespaceUnsupported Responses tool type: tool_search这会导致
codex/codex exec虽然已经正确连到了代理,但仍然无法在真实本地项目工作流中使用。这个 PR 的目标,是让 WindsurfAPI 能作为 Codex Responses 客户端的兼容层正常工作,而不需要修改 Codex 本体。
测试
本次为手动验证。
1. 语法检查
执行了: