Unverified Commit 24d19a5f authored by kzw200015's avatar kzw200015 Committed by GitHub
Browse files

fix: 从codex请求参数中移除max_output_tokens (#231)

某些客户端比如 opencode 会在请求中附加 max_output_tokens,这会导致上游返回400错误
parent ff087586
......@@ -545,6 +545,8 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco
// 2. Normalize input format for Codex API compatibility
if account.Type == AccountTypeOAuth {
reqBody["store"] = false
// Codex 上游不接受 max_output_tokens 参数,需要在转发前移除。
delete(reqBody, "max_output_tokens")
bodyModified = true
// Normalize input format: convert AI SDK multi-part content format to simplified format
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment