Skip to content

Sub-agents fail with OpenAI OAuth: Missing scope api.responses.write #24927

@samehdagash

Description

@samehdagash

Problem

Sub-agents (Pi embedded agent) cannot use openai/gpt-5.2 or openai/gpt-5.2-pro with OAuth Pro subscription tokens.

Error:

HTTP 401: You have insufficient permissions for this operation. 
Missing scopes: api.responses.write.

Root Cause

  • Sub-agents use the Responses API (/v1/responses) via openai-responses provider
  • The main session uses Chat Completions API (/v1/chat/completions) — works fine
  • OAuth tokens from ChatGPT Pro subscription ($200/mo) only have scopes: openid, profile, email, offline_access
  • The api.responses.write scope is not available via the Codex OAuth client (app_EMoamEEZ73f0CkXaXp7hrann)
  • Confirmed with both browser OAuth and device-code auth flow — same scopes

Expected Behavior

Sub-agents should work with OpenAI OAuth Pro tokens, either by:

  1. Requesting api.responses.write scope in the OAuth client registration
  2. Falling back to Chat Completions API when Responses API returns 401/scope error
  3. Using openai-codex-responses provider (chatgpt.com/backend-api) which works with the same token

Environment

  • OpenClaw: 2026.2.22-2
  • OpenAI subscription: Pro ($200/mo)
  • Auth mode: OAuth (device-code + browser)
  • codex CLI: 0.104.0

Workaround

Use openai-codex/gpt-5.3-codex for sub-agents (works via chatgpt.com/backend-api).
Main session can use openai/gpt-5.2 normally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions