fix(agents): include azure-openai in Responses API store override#42934
Conversation
The `OPENAI_RESPONSES_PROVIDERS` set only contained `openai` and `azure-openai-responses`, so users who configure the `azure-openai` provider with `api: "openai-responses"` never had pi-ai's upstream `store: false` overridden to `true`. This caused all Azure OpenAI multi-turn cron jobs and embedded agent runs to fail with HTTP 400 "store is set to false" after the 2026.3.8 store-stripping changes. Add `azure-openai` to the provider set and a regression test. Fixes openclaw#42800
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟡 Forced
|
| Property | Value |
|---|---|
| Severity | Medium |
| CWE | CWE-359 |
| Location | src/agents/pi-embedded-runner/openai-stream-wrappers.ts:127-129 |
Description
createOpenAIResponsesContextManagementWrapper mutates outgoing openai-responses payloads and forces payload.store = true when shouldForceResponsesStore(model) is true.
With this change, shouldForceResponsesStore now matches the azure-openai provider as well, meaning prompts/outputs for Azure OpenAI Responses requests can be flagged for provider-side storage even when upstream/default behavior was store:false.
Impact:
- For
model.api === "openai-responses"andmodel.provider === "azure-openai"(and a direct Azure OpenAI base URL), the wrapper overwritespayload.storetotrue. - This can unintentionally enable persistence/retention of end-user prompts and model outputs with the provider, potentially violating “no-store” expectations and organizational compliance requirements.
- There is no explicit opt-out knob in
extraParamsfor the store override (other than settingcompat.supportsStore=false, which is not a user-controlled privacy setting).
Vulnerable behavior (provider classification + forced mutation):
const OPENAI_RESPONSES_PROVIDERS = new Set(["openai", "azure-openai", "azure-openai-responses"]);
...
if (params.forceStore) {
params.payloadObj.store = true;
}Recommendation
Add an explicit configuration/guardrail so store=true is not silently enabled for Azure/OpenAI Responses requests.
Recommended options (pick one):
- Require explicit opt-in (fail closed by default):
- Introduce an extra param such as
responsesForceStore/allowResponsesStore. - Only set
payload.store = truewhen that flag istrue. - If Azure OpenAI would 400 without
store=true, throw a clear error telling the operator how to opt in.
- Allow explicit opt-out override:
- If the caller/config explicitly sets
store: false, do not override it; instead surface a warning/error.
Example (opt-out respected + explicit error):
function applyOpenAIResponsesPayloadOverrides({ payloadObj, forceStore, ...rest }: Params) {
if (forceStore) {
if (payloadObj.store === false) {
throw new Error("Azure/OpenAI Responses requires store=true; configure allowResponsesStore=true or switch APIs.");
}
payloadObj.store = true;
}
}Also document this behavior prominently (changelog/docs) so operators understand that Azure OpenAI Responses runs may store conversation data when enabled.
Analyzed PR: #42934 at commit d3285fe
Last updated on: 2026-03-11T08:05:30Z
Greptile SummaryThis PR fixes a regression introduced in 2026.3.8 where Azure OpenAI multi-turn cron jobs and embedded agent runs were failing with HTTP 400 "store is set to false". The root cause was that Key changes:
Note that Confidence Score: 5/5
Last reviewed commit: 19b3c46 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Merged via squash.
Thanks @ademczuk! |
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
* main: (49 commits) fix(agents): add nodes to owner-only tool policy fallbacks fix(gateway): propagate real gateway client into plugin subagent runtime fix(gateway): enforce caller-scope subsetting in device.token.rotate fix(terminal): stabilize skills table width across Terminal.app and iTerm (openclaw#42849) fix(models): guard optional model input capabilities (openclaw#42096) macOS/onboarding: prompt for remote gateway auth tokens (openclaw#43100) fix(macos): use foundationValue when serializing browser proxy POST body (openclaw#43069) feat(ios): add local beta release flow (openclaw#42991) docs(changelog): update context pruning PR reference fix(context-pruning): cover image-only tool-result pruning fix(context-pruning): prune image-containing tool results instead of skipping them (openclaw#41789) fix(agents): include azure-openai in Responses API store override (openclaw#42934) fix(telegram): fall back on ambiguous first preview sends fix(telegram): prevent duplicate messages with slow LLM providers (openclaw#41932) Providers: add Opencode Go support (openclaw#42313) fix(sandbox): sanitize Docker env before marking OPENCLAW_CLI (openclaw#42256) macOS: add chat model selector and persist thinking (openclaw#42314) fix: clear pnpm prod audit vulnerabilities fix(build): restore full gate fix(gateway): split conversation reset from admin reset ...
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn
…enclaw#42934) Merged via squash. Prepared head SHA: d3285fe Co-authored-by: ademczuk <[email protected]> Co-authored-by: frankekn <[email protected]> Reviewed-by: @frankekn (cherry picked from commit dc44413)
Fixes #42800
OPENAI_RESPONSES_PROVIDERSonly containedopenaiandazure-openai-responses, so theazure-openaiprovider configured withapi: "openai-responses"never had pi-ai's upstreamstore: falseoverridden totrue. This broke all Azure OpenAI multi-turn cron jobs after 2026.3.8.Adds
"azure-openai"to the provider set and a regression test covering the exact scenario from the issue.Testing
npx vitest run src/agents/pi-embedded-runner-extraparams.test.tspasses (67/67 including the new test)store === trueforazure-openaiprovider withopenai-responsesAPI and*.openai.azure.combase URLChangelog
Updated.