History

Normalize compact Codex instructions field

benjamin committed 7 months ago

Commit 39632d71 parent f438e591 file · +3 −0Browse files

Unified · Split

internal/runtime/executor/codex_executor.go+3−0
@@ -218,6 +218,9 @@ func (e *CodexExecutor) executeCompact(ctx context.Context, auth *cliproxyauth.A · 217 unmodified lines
218 body = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel)218 body = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel)
219 body, _ = sjson.SetBytes(body, "model", baseModel)219 body, _ = sjson.SetBytes(body, "model", baseModel)
220 body, _ = sjson.DeleteBytes(body, "stream")220 body, _ = sjson.DeleteBytes(body, "stream")
221 if !gjson.GetBytes(body, "instructions").Exists() {
222 body, _ = sjson.SetBytes(body, "instructions", "")
223 }
221 224
222 url := strings.TrimSuffix(baseURL, "/") + "/responses/compact"225 url := strings.TrimSuffix(baseURL, "/") + "/responses/compact"
223 httpReq, err := e.cacheHelper(ctx, from, url, req, body)226 httpReq, err := e.cacheHelper(ctx, from, url, req, body)