Skip to content

fix(auth): relogin repairs stale profile order after upgrade - #135355

Merged
obviyus merged 1 commit into
mainfrom
codex/fix-135140-openai-auth-profile
Sep 1, 2026
Merged

obviyus merged 1 commit into
mainfrom
codex/fix-135140-openai-auth-profile

Conversation

@obviyus

@obviyus obviyus commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #135140

Reported by @mattcbianco.

What Problem This Solves

Fixes an issue where users who signed in to OpenAI again after shared auth-store relocation could still get Explicit auth order for openai has no usable profiles. before a model request started.

Why This Change Was Made

Login credentials and per-agent profile order have separate SQLite owners after relocation. Profile promotion now reads the effective credential view before it updates the agent-local order, and it preserves the inherited profile ID when it saves that order.

This keeps explicit order fail-closed behavior unchanged. It does not add a dispatch fallback or copy shared OAuth credentials into the agent database.

User Impact

A successful OpenAI relogin now places the new usable profile before stale entries, so the next openai/* model call can start with the login that just succeeded.

Evidence

  • Current-main baseline: 2e3f734017b9b1a5a32ba11d844d1fa7a5141de9.
  • Before: Codex reported a healthy ChatGPT login and OpenClaw listed a healthy OAuth profile, but the selected Codex runtime had no effective profile. Real Luna and Sol turns stopped before provider dispatch with Explicit auth order for openai has no usable profiles.
  • After: OpenClaw device login stored the fresh OAuth profile, agent-local order became [fresh, stale], and status reported a usable Codex runtime route.
  • Live exact-head result: a real openclaw agent --local Luna turn returned exactly ISSUE_135140_EXACT_HEAD_GREEN_2 through provider openai.
  • Shipped CLI regression: models auth login --provider openai --agent main failed on the baseline because local order stayed absent; passed after the fix with [fresh, stale].
  • Focused CLI, owner, and sibling tests: 131 passed across login promotion, auth upsert/rollback, shared-store relocation, and runtime auth planning.
  • Oxfmt, Oxlint, and git diff --check: passed.
  • Autoreview P0: clean.

Production delta: +4/-5 (net -1). Test delta: +108/-0.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Sep 1, 2026
@obviyus
obviyus marked this pull request as ready for review September 1, 2026 16:40
@obviyus
obviyus requested a review from a team as a code owner September 1, 2026 16:40
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Sep 1, 2026
@obviyus
obviyus force-pushed the codex/fix-135140-openai-auth-profile branch from 2700561 to 1763832 Compare September 1, 2026 16:49
@obviyus

obviyus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 135355
head: 1763832
breaking: 4fb5d93
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Verification is complete on exact head 1763832175cb480d98bb64c17f00910340c6461a.

Known gate: @openclaw/openclaw-secops review is requested for the CODEOWNERS-protected auth path.

@obviyus
obviyus requested a review from joshavant September 1, 2026 17:12
@obviyus

obviyus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 135355
head: 1763832
breaking: 6c6716a
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 135355
head: 1763832
breaking: c147f393f4743939f27e705768c08e93d1c3ed1f
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 135355
head: 1763832
breaking: c147f39
check: openclaw/ci-gate

@obviyus
obviyus merged commit bf9a04e into main Sep 1, 2026
269 of 275 checks passed
@obviyus
obviyus deleted the codex/fix-135140-openai-auth-profile branch September 1, 2026 17:26
@obviyus

obviyus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @mattcbianco!

Proof: After a real OpenAI ChatGPT device login, OpenClaw promoted the fresh OAuth profile and a real local Luna model call returned ISSUE_135140_EXACT_HEAD_GREEN_2 through provider openai.

  • Bug: A successful relogin could leave stale agent-local auth order ahead of the healthy shared OpenAI OAuth profile, so model calls stopped before network dispatch.
  • Fix: Profile promotion now reads the effective credential view and preserves inherited profile IDs when it saves agent-local order.
Before After
Healthy ChatGPT login, but Explicit auth order for openai has no usable profiles. Fresh OAuth profile selected and the real openai/* model call completes

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai/* model calls fail instantly with "Explicit auth order for openai has no usable profiles" after 2026.8.1 upgrade (ChatGPT OAuth is healthy)

1 participant