Skip to content

[Bug]: 400 Bad Request on Codex API call with gpt-5.3-codex in Headless Device Auth mode #794

@nhh0718

Description

@nhh0718

Quick Summary

PicoClaw fails to execute LLM calls with gpt-5.3-codex using Device Code authentication (Headless mode). The backend returns a 400 Bad Request error specifically targeting model compatibility or missing/mismatched account-id headers.

Environment & Tools

  • PicoClaw Version: v0.1.2 (or current main branch)
  • Go Version: go 1.25
  • AI Model & Provider: gpt-5.3-codex via OpenAI Codex (Headless Device Auth)
  • Operating System: Ubuntu 24.04
  • Channels: CLI

📸 Steps to Reproduce

  1. Authenticate using the headless device flow: picoclaw auth login --provider openai --device-code
  2. Complete the verification process via the provided URL and code.
  3. Configure the agent to use gpt-5.3-codex as the primary model.
  4. Trigger an agent task (e.g., via cli:cron or a simple prompt like "hello").
  5. Observe the logs during the LLM provider call.

❌ Actual Behavior

The agent initializes correctly, but the LLM call fails immediately with the following error:

[ERROR] provider.codex: Codex API call failed {
  resolved_model=gpt-5.3-codex, 
  account_id_present=true, 
  error=POST "https://chatgpt.com/backend-api/codex/responses": 400 Bad Request, 
  status_code=400, 
  hint=verify account id header and model compatibility for codex backend
}

✅ Expected Behavior

The request should be successfully authorized and processed by the OpenAI Codex backend, returning the generated code or response to the PicoClaw agent.

💬 Additional Context

  • The authentication itself reports as successful, and account_id_present is flagged as true in the logs.
  • The error "400 Bad Request" with the hint about "model compatibility" suggests that the gpt-5.3-codex model might require specific headers or a slightly different endpoint structure in the 2026 API update compared to previous GPT-4 based Codex models.
  • This might be related to the recent ChatGPT Plus session token management changes for high-tier models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions