Skip to content

openai-codex/gpt-5.3-codex fails with "Store must be set to false" - isDirectOpenAIBaseUrl() treats empty baseUrl as direct OpenAI #16914

@zhangwei

Description

@zhangwei

Bug Report

Every request with openai-codex/gpt-5.3-codex (Codex subscription via OAuth) fails immediately:

run error: {"detail":"Store must be set to false"}

Root Cause

isDirectOpenAIBaseUrl() in src/agents/pi-embedded-runner/extra-params.ts (line 107) returns true for empty/falsy baseUrl:

if (typeof baseUrl !== "string" || !baseUrl.trim()) {
    return true;  // BUG: empty string != direct OpenAI
}

gpt-5.3-codex is registered in models.generated.js with baseUrl: "" and provider: "azure-openai-responses". The empty baseUrl causes shouldForceResponsesStore() -> createOpenAIResponsesStoreWrapper() (line 149) to force store = true on the request payload. OpenAI then rejects it.

Call chain:

applyExtraParamsToAgent()                          (line 213)
  +-- createOpenAIResponsesStoreWrapper()           (line 137)
       +-- shouldForceResponsesStore(model)         (line 120)
            +-- isDirectOpenAIBaseUrl(model.baseUrl) (line 107)
                 +-- baseUrl is "" -> !("".trim()) -> true  <- BUG
                      +-- wrapper forces store = true
                           +-- OpenAI rejects

Additionally, azure-openai-responses.js in @mariozechner/pi-ai never sets store: false in buildParams(), unlike openai-codex-responses.js and openai-responses.js which both do.

Suggested Fix

Simply changing isDirectOpenAIBaseUrl() to return false for empty strings would break actual direct OpenAI models that also have empty baseUrl and legitimately need store: true for multi-turn server-side state.

The fix should be in shouldForceResponsesStore() — exclude azure-openai-responses from the providers that force store, since azure-routed models shouldn't have store: true forced even if they ultimately reach OpenAI:

function shouldForceResponsesStore(model: {
    api?: unknown;
    provider?: unknown;
    baseUrl?: unknown;
}): boolean {
    if (typeof model.api !== "string" || typeof model.provider !== "string") {
        return false;
    }
    if (!OPENAI_RESPONSES_APIS.has(model.api)) {
        return false;
    }
    // Azure-routed models should not have store forced to true
    if (model.provider === "azure-openai-responses") {
        return false;
    }
    if (!OPENAI_RESPONSES_PROVIDERS.has(model.provider)) {
        return false;
    }
    return isDirectOpenAIBaseUrl(model.baseUrl);
}

As defense-in-depth, azure-openai-responses.js buildParams() should also explicitly set store: false, matching the other two providers.

Steps to Reproduce

  1. Set up OpenClaw with Codex subscription (OAuth)
  2. Configure openai-codex/gpt-5.3-codex as primary model
  3. Send any message
  4. Observe: run error: {"detail":"Store must be set to false"}

Expected Behavior

Requests should succeed. The store parameter should remain false for models routed through azure-openai-responses with empty baseUrl.

Environment

  • OpenClaw version: 2026.2.15
  • Provider: openai-codex (Codex subscription, OAuth)
  • Model: openai-codex/gpt-5.3-codex
  • Runtime: Docker
  • pi-ai: @mariozechner/[email protected]
  • OS: Linux (Docker)

Log Output

[openclaw] {"detail":"Store must be set to false"}
run error: {"detail":"Store must be set to false"}
connected | error
agent main | session main (openclaw-tui) | openai-codex/gpt-5.3-codex | think low | tokens 188k/272k (69%)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions