mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-24 19:04:25 +08:00
fix(codex): allow hosted image_generation injection on standard Responses without reasoning
- gate automatic image_generation tool injection for use_responses_lite catalog models on actual Responses-Lite routing (including credential and model header overrides) or presence of reasoning effort - retract untouched auto-injected image_generation tools during single-pass payload finalization when user payload rules configure reasoning effort or switch to an incompatible route - update Codex executor and payload barrier regression tests across HTTP and WebSocket streaming and non-streaming paths Closes: #7384 Co-authored-by: Dylan <1990016@gmail.com>
This commit is contained in:
@@ -65,7 +65,7 @@ func (e *CodexExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re
|
||||
return resp, err
|
||||
}
|
||||
|
||||
ctx = helps.WithPayloadFinalizer(ctx, helps.NewPayloadFinalizer(e.cfg, e.Identifier(), baseModel, to.String(), "", originalTranslated, req, opts))
|
||||
ctx = helps.WithPayloadFinalizer(ctx, helps.NewPayloadFinalizer(e.cfg, e.Identifier(), baseModel, to.String(), "", originalTranslated, req, opts, auth))
|
||||
helps.SetStringIfDifferentDoc(doc, "model", baseModel)
|
||||
helps.SetBoolIfDifferentDoc(doc, "stream", true)
|
||||
_ = doc.Delete("previous_response_id")
|
||||
@@ -80,7 +80,11 @@ func (e *CodexExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re
|
||||
if !useSIWC {
|
||||
normalizeCodexInstructionsDoc(doc, helps.IsNativeCodexRequest(req.Payload, opts))
|
||||
if e.cfg == nil || e.cfg.DisableImageGeneration == config.DisableImageGenerationOff {
|
||||
ensureImageGenerationToolDoc(doc, baseModel, auth, opts.Headers)
|
||||
checkModel := req.Model
|
||||
if strings.TrimSpace(checkModel) == "" {
|
||||
checkModel = baseModel
|
||||
}
|
||||
ensureImageGenerationToolDoc(doc, checkModel, auth, opts.Headers)
|
||||
if !codexAuthUsesAPIKey(auth) {
|
||||
normalizeCodexImageGenerationToolsDoc(doc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user