fix(openai): restore API-key custom tool calls - #5661
Merged
Wei-Shaw merged 1 commit intoAug 18, 2026
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
问题
OpenAI 平台 API-key 原生
/v1/responses路径未适配 Codex 的 custom/freeform 工具,上游返回对象参数后会导致apply_patch报invoked with incompatible payload。根因
该路径未复用已有 Responses 客户端工具适配器,既没有在请求侧把 custom 工具降级为 function,也没有在流式/非流式响应侧恢复为
custom_tool_call的字符串input。改动
测试
go test -tags=unit ./internal/service -run 'Test(OpenAIPassthroughAPIKeyRestoresClientTools|AdaptOpenAIResponsesClientTools|ClearOpenAIResponsesClientToolMapping|OpenAIGatewayServiceForward_AccountPolicyStripsImageNamespaceTools)' -count=1go test -json -tags=unit ./internal/service -count=1go vet -tags=unit ./internal/servicegit diff --checkFixes #5659