Skip to content

fix(agents): include azure-openai in Responses API store override#42934

Merged
frankekn merged 2 commits intoopenclaw:mainfrom
ademczuk:fix/azure-openai-responses-store-regression
Mar 11, 2026
Merged

fix(agents): include azure-openai in Responses API store override#42934
frankekn merged 2 commits intoopenclaw:mainfrom
ademczuk:fix/azure-openai-responses-store-regression

Conversation

@ademczuk
Copy link
Member

Fixes #42800

OPENAI_RESPONSES_PROVIDERS only contained openai and azure-openai-responses, so the azure-openai provider configured with api: "openai-responses" never had pi-ai's upstream store: false overridden to true. 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.ts passes (67/67 including the new test)
  • New test asserts store === true for azure-openai provider with openai-responses API and *.openai.azure.com base URL

Changelog

Updated.

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-research-bot
Copy link

aisle-research-bot bot commented Mar 11, 2026

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🟡 Medium Forced store=true for Azure OpenAI Responses requests may cause unintended data retention

1. 🟡 Forced store=true for Azure OpenAI Responses requests may cause unintended data retention

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" and model.provider === "azure-openai" (and a direct Azure OpenAI base URL), the wrapper overwrites payload.store to true.
  • 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 extraParams for the store override (other than setting compat.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):

  1. Require explicit opt-in (fail closed by default):
  • Introduce an extra param such as responsesForceStore / allowResponsesStore.
  • Only set payload.store = true when that flag is true.
  • If Azure OpenAI would 400 without store=true, throw a clear error telling the operator how to opt in.
  1. 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

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: XS labels Mar 11, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This 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 OPENAI_RESPONSES_PROVIDERS only contained "openai" and "azure-openai-responses", so the "azure-openai" provider configured with api: "openai-responses" never had pi-ai's upstream store: false overridden to true by shouldForceResponsesStore.

Key changes:

  • openai-stream-wrappers.ts: Adds "azure-openai" to OPENAI_RESPONSES_PROVIDERS. The existing isDirectOpenAIBaseUrl guard already handles *.openai.azure.com hostnames, so the complete logic chain (api === "openai-responses" → provider in set → Azure base URL check) works correctly with no further changes.
  • pi-embedded-runner-extraparams.test.ts: Adds a focused regression test that starts with { store: false } and asserts store === true after mutation, precisely mirroring the failing production scenario from issue bug: Azure OpenAI Responses API — store: false regression in 2026.3.8 breaks all multi-turn cron jobs #42800.
  • CHANGELOG.md: Entry added with issue reference and contributor credit.

Note that shouldEnableOpenAIResponsesServerCompaction still only auto-enables server compaction for provider === "openai" (line 104), not for azure-openai. This appears intentional — Azure OpenAI Responses may not support the context_management compaction feature — but is worth awareness if that feature is extended to Azure in the future.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted bug fix with a direct regression test and no behavioural changes to unrelated code paths.
  • The change is a one-token addition to a Set literal. The fix is logically correct: the missing provider entry was the exact cause of the regression, isDirectOpenAIBaseUrl already handles Azure hostnames, and all surrounding guard conditions (compat.supportsStore, API type check, base-URL check) remain fully intact. The new test exercises the precise failure scenario end-to-end and the PR author confirms the 67-test suite passes. Risk of unintended side-effects is essentially zero.
  • No files require special attention.

Last reviewed commit: 19b3c46

@frankekn frankekn self-assigned this Mar 11, 2026
@frankekn
Copy link
Contributor

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@frankekn frankekn merged commit dc44413 into openclaw:main Mar 11, 2026
28 checks passed
@frankekn
Copy link
Contributor

Merged via squash.

Thanks @ademczuk!

frankekn added a commit to MoerAI/openclaw that referenced this pull request Mar 11, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
frankekn added a commit to Effet/openclaw that referenced this pull request Mar 11, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
frankekn added a commit to ImLukeF/openclaw that referenced this pull request Mar 11, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
@ademczuk ademczuk deleted the fix/azure-openai-responses-store-regression branch March 11, 2026 12:07
hydro13 pushed a commit to andyliu/openclaw that referenced this pull request Mar 11, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Treedy2020 pushed a commit to Treedy2020/openclaw that referenced this pull request Mar 11, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Mar 11, 2026
* 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
  ...
dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
ahelpercn pushed a commit to ahelpercn/openclaw that referenced this pull request Mar 12, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Ruijie-Ysp pushed a commit to Ruijie-Ysp/clawdbot that referenced this pull request Mar 12, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
leozhengliu-pixel pushed a commit to leozhengliu-pixel/openclaw that referenced this pull request Mar 13, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
plabzzxx pushed a commit to plabzzxx/openclaw that referenced this pull request Mar 13, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
wdskuki pushed a commit to wdskuki/openclaw that referenced this pull request Mar 16, 2026
…enclaw#42934)

Merged via squash.

Prepared head SHA: d3285fe
Co-authored-by: ademczuk <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Interstellar-code pushed a commit to Interstellar-code/operator1 that referenced this pull request Mar 16, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Azure OpenAI Responses API — store: false regression in 2026.3.8 breaks all multi-turn cron jobs

2 participants