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
218218 body = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel)
219219 body, _ = sjson.SetBytes(body, "model", baseModel)
220220 body, _ = sjson.DeleteBytes(body, "stream")
221+ if !gjson.GetBytes(body, "instructions").Exists() {
222+ body, _ = sjson.SetBytes(body, "instructions", "")
223+ }
221224
222225 url := strings.TrimSuffix(baseURL, "/") + "/responses/compact"
223226 httpReq, err := e.cacheHelper(ctx, from, url, req, body)