Skip to content

OpenAI OAuth missing 'model.request' scope — GPT-5.5 falls back silently #90536

Closed as not planned

Description

@ozp

Bug

OpenClaw 2026.6.1 (2e08f0f) — OpenAI ChatGPT Plus OAuth flow does not request the model.request scope, causing all openai/* model calls to fail with HTTP 401 and silently fall back to the next configured model.

What happened

  • Primary model: openai/gpt-5.5 (ChatGPT Plus OAuth, openai:oliver.prado@gmail.com)
  • Fallback: litellm-anthropic/glm-5.1
  • OAuth login succeeds, token is issued, but API calls return:
{
  "error": {
    "message": "You have insufficient permissions for this operation. Missing scopes: model.request.",
    "type": "invalid_request_error",
    "code": "missing_scope"
  }
}
  • Result: every request silently falls back to the fallback model. No visible error to the user.

Root cause

The OAuth scope string in openai-chatgpt-oauth-flow.runtime-*.js is:

const SCOPE = "openid profile email offline_access";

OpenAI now requires model.request for chat completion API access. This scope is not being requested.

The probe URL in openai-chatgpt-oauth.runtime-*.js also only requests openid+profile+email.

Workaround

Manually patch the scope to include model.request:

const SCOPE = "openid profile email offline_access model.request";

Then restart gateway and re-run openclaw models auth login.

Expected fix

Update the default OAuth scope string to include model.request (or whatever scope OpenAI currently requires for model access).

Environment

  • OpenClaw 2026.6.1 (2e08f0f)
  • Linux x64
  • ChatGPT Plus plan
  • chatgptPlanType: plus in auth profile

Activity

  1. clawsweeper commented on Jun 5, 2026

    @clawsweeper
    Contributor

    Thanks for the report. I checked current main, but this shell is missing enough reproduction detail to verify a current bug.

    The reporter’s successful connector-scope workaround is useful historical evidence, but the only reproduction is from June on 2026.6.1. Current authentication and routing distinguish several credential types and endpoints; the unchanged scope string alone does not establish a remaining model-access defect.

    Review details

    Best possible solution:

    Keep credential-specific routing and use Settings → Models → Connect provider → Test & use to verify current access before considering any broader OAuth grant.

    Do we have a high-confidence way to reproduce the issue?

    No high-confidence current-main reproduction is established. The June workaround succeeded, but the original failing request’s endpoint and runtime are unspecified and no recent release reproduction was added.

    Is this the best way to solve the issue?

    No: adding model.request is contradicted by the reporter’s authorization failure and prior merged scope correction. Connector-scope expansion needs a current credential-and-endpoint reproduction before it can be justified as an inference repair.

    Security review:

    Security review: This is authentication-failure triage without a proposed patch or demonstrated security-boundary violation.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Historical workaround and activity: The reporter’s June 5 follow-ups say model.request broke browser authorization, whereas connector scopes produced OPENAI_OK with fallbackUsed=false. Live discussion inspection found no subsequent human reproduction; later comments are stale notices. OpenAI OAuth missing 'model.request' scope — GPT-5.5 falls back silently #90536 (comment).
    • Scope difference remains: Current browser authorization requests openid profile email offline_access. This confirms the scope difference remains, but does not prove it causes inference failure. (extensions/openai/openai-chatgpt-oauth-authorization.runtime.ts:9, aacb4fa81796)
    • Current credential contract: Authentication documentation separates Codex login, Sign in with ChatGPT, and Platform API keys with different model endpoints. It explicitly identifies connector scopes as necessary for OpenAI-hosted plugin invocation and states OpenClaw browser login does not request them. Public docs: docs/providers/openai/authentication.md. (docs/providers/openai/authentication.md:64, aacb4fa81796)
    • Native Codex scope comparison: The reporter explicitly based the workaround on native Codex scopes, and current OpenClaw documentation directs connector-scoped grants to native Codex sign-in. Personally inspected native authorization source requests api.connectors.read and api.connectors.invoke. Ownership was verified through the checkout’s backing cache remote https://github.com/openai/codex.git; this comparison does not establish that ordinary OpenClaw inference requires those scopes. (codex-rs/login/src/server.rs:607, a956835d0207)
    • Existing unsupported-scope correction: GitHub verifies fix(auth): stop forcing unsupported Codex OAuth scopes #64713 merged April 11, removing forced model.request and api.responses.write because authorization rejected them. This predates the reported incident and is context, not proof that this issue is fixed. (58708e6f8854)
    • Current route ownership: Current provider code differentiates authored Platform routes from ChatGPT Responses routes and delegates subscription transport normalization to its ChatGPT provider hooks. Nearby tests distinguish OAuth and API-key routes. Neither source inspection nor these supplemental tests establishes a failing current-main login-to-turn path. (extensions/openai/openai-provider.ts:570, aacb4fa81796)

    Likely related people:

    • stevenlee-oai: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

    Codex review notes: model internal, reasoning medium; reviewed against aacb4fa81796.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 5, 2026
  3. ozp commented on Jun 5, 2026

    @ozp
    Author

    Follow-up from local testing: adding only model.request to the OpenAI ChatGPT OAuth authorize scope caused the browser OAuth flow itself to fail with an OpenAI authentication error before token issuance (request id c7b5211d-5493-4493-ae1e-f583212d2e71). Based on ClawSweeper review noting upstream Codex currently requests api.connectors.read api.connectors.invoke, I am testing that scope pair locally next. This suggests the API 401 message naming model.request may not map 1:1 to an accepted OAuth consent scope for this client.

  4. ozp commented on Jun 5, 2026

    @ozp
    Author

    Final local validation: after changing the OpenAI ChatGPT OAuth authorize scope to openid profile email offline_access api.connectors.read api.connectors.invoke and re-running openclaw models auth login --agent main, a direct smoke test succeeded: openclaw agent --agent main --session-key agent:main:oauth-smoke-test --model openai/gpt-5.5 --thinking off --json --timeout 120 --message "Smoke test. Reply with exactly: OPENAI_OK". Result: winnerProvider=openai, winnerModel=gpt-5.5, fallbackUsed=false, response OPENAI_OK. This confirms the connector scopes restored GPT-5.5 access locally, while model.request alone broke browser OAuth authorization.

  5. added
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Jun 15, 2026
  6. 13 remaining items

  7. added
    impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    and removed
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Sep 5, 2026
  8. openclaw-barnacle commented on Sep 20, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  9. added
    staleMarked as stale due to inactivity
    and removed
    staleMarked as stale due to inactivity
    on Sep 20, 2026
  10. added
    P2Normal backlog priority with limited blast radius.
    and removed
    P1High-priority user-facing bug, regression, or broken workflow.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Sep 22, 2026
  11. openclaw-barnacle commented on Oct 7, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions