diff --git a/internal/runtime/executor/codex_executor.go b/internal/runtime/executor/codex_executor.go index c09da7ac..01ba2175 100644 --- a/internal/runtime/executor/codex_executor.go +++ b/internal/runtime/executor/codex_executor.go @@ -622,13 +622,17 @@ func (e *CodexExecutor) cacheHelper(ctx context.Context, from sdktranslator.Form } } - rawJSON, _ = sjson.SetBytes(rawJSON, "prompt_cache_key", cache.ID) + if cache.ID != "" { + rawJSON, _ = sjson.SetBytes(rawJSON, "prompt_cache_key", cache.ID) + } httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(rawJSON)) if err != nil { return nil, err } - httpReq.Header.Set("Conversation_id", cache.ID) - httpReq.Header.Set("Session_id", cache.ID) + if cache.ID != "" { + httpReq.Header.Set("Conversation_id", cache.ID) + httpReq.Header.Set("Session_id", cache.ID) + } return httpReq, nil }