fix(codex): normalize null instructions for compact requests

This commit is contained in:
MonsterQiu
2026-03-30 22:58:05 +08:00
parent d11936f292
commit d3b94c9241
2 changed files with 60 additions and 38 deletions

View File

@@ -220,7 +220,8 @@ func (e *CodexExecutor) executeCompact(ctx context.Context, auth *cliproxyauth.A
body = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel)
body, _ = sjson.SetBytes(body, "model", baseModel)
body, _ = sjson.DeleteBytes(body, "stream")
if !gjson.GetBytes(body, "instructions").Exists() {
instructions := gjson.GetBytes(body, "instructions")
if !instructions.Exists() || instructions.Type == gjson.Null {
body, _ = sjson.SetBytes(body, "instructions", "")
}