Merge pull request #2422 from MonsterQiu/fix/codex-compact-instructions

fix(codex): add default instructions for /responses/compact
This commit is contained in:
Luis Pater
2026-03-31 12:14:20 +08:00
committed by GitHub
2 changed files with 83 additions and 0 deletions

View File

@@ -219,6 +219,10 @@ 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")
instructions := gjson.GetBytes(body, "instructions")
if !instructions.Exists() || instructions.Type == gjson.Null {
body, _ = sjson.SetBytes(body, "instructions", "")
}
url := strings.TrimSuffix(baseURL, "/") + "/responses/compact"
httpReq, err := e.cacheHelper(ctx, from, url, req, body)