Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
24d19a5f
Unverified
Commit
24d19a5f
authored
Jan 10, 2026
by
kzw200015
Committed by
GitHub
Jan 10, 2026
Browse files
fix: 从codex请求参数中移除max_output_tokens (#231)
某些客户端比如 opencode 会在请求中附加 max_output_tokens,这会导致上游返回400错误
parent
ff087586
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/service/openai_gateway_service.go
View file @
24d19a5f
...
@@ -545,6 +545,8 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco
...
@@ -545,6 +545,8 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco
// 2. Normalize input format for Codex API compatibility
// 2. Normalize input format for Codex API compatibility
if
account
.
Type
==
AccountTypeOAuth
{
if
account
.
Type
==
AccountTypeOAuth
{
reqBody
[
"store"
]
=
false
reqBody
[
"store"
]
=
false
// Codex 上游不接受 max_output_tokens 参数,需要在转发前移除。
delete
(
reqBody
,
"max_output_tokens"
)
bodyModified
=
true
bodyModified
=
true
// Normalize input format: convert AI SDK multi-part content format to simplified format
// Normalize input format: convert AI SDK multi-part content format to simplified format
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment