fix(openai): make store opt-in so it stops leaking to non-OpenAI backends (#4757)

This commit is contained in:
Yunsu
2026-04-13 21:53:22 +05:30
committed by GitHub
parent 4180409b09
commit 7b395f3bf7
3 changed files with 68 additions and 8 deletions
+6 -5
View File
@@ -126,11 +126,12 @@ class OpenAILLM(LLMBase):
params.update(**openrouter_params)
else:
openai_specific_generation_params = ["store"]
for param in openai_specific_generation_params:
if hasattr(self.config, param):
params[param] = getattr(self.config, param)
# Only send OpenAI-specific parameters when the user has explicitly
# configured them. OpenAI-compatible backends (Gemini, Groq, vLLM, etc.)
# reject unknown fields, so `store` must be opt-in, not opt-out.
if self.config.store is not None:
params["store"] = self.config.store
if response_format:
params["response_format"] = response_format
if tools: # TODO: Remove tools if no issues found with new memory addition logic