GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): Codex credential sync targets the account's instance door (code#7991) by dezren39 · Pull Request #2237 · developing-today-forks/opencode

Conversation

@dezren39

@dezren39 dezren39 commented Nov 9, 2026

Copy link
Copy Markdown

What was wrong

The Muse owns the ChatGPT token lineage for the main OpenAI account and refreshes ~/.codex/auth.json itself (it did, on schedule, 2026-11-09T02:49Z; its current access token is valid to 2026-11-19). CodexSync is supposed to copy those tokens into the credential store every minute.

It listed credentials only under the base openai integration:

const saved = yield* credentials.list(integrationID) // "openai"

Deployed configurations keep the ChatGPT credentials on instance doors — openai.main, openai.alternate — and there is no credential under openai. The sync therefore returned no-credential, silently, every minute, forever. The stored openai.main credential was never updated after 2026-11-03; its access token's real JWT expiry passed 2026-11-09T02:51Z and 57–59 of 61 fleet sessions began dying with "Provided authentication token is expired" (developing-today/code#7991).

The fix

CodexSync.selectTarget now picks the credential the auth file actually belongs to:

  • The target is the OAuth credential whose stored account ID equals the file's account ID, searched across the base openai integration and its instance doors (openai.*).
  • With no account match (including files with no account ID), selection falls back to the base integration's selected credential, exactly as before — existing statuses (no-credential, not-oauth, diverged, unchanged) are preserved.
  • One account's tokens are never written into another account's credential.

This is the auth-handling fix Drew authorized on 2026-11-09: "If needed, fork the OpenAI provider as _openai and fix it in the provider." A new provider door was not needed — the existing door serves fine once fed; the defect was this sync's targeting inside the fork's credential code.

Tests

  • packages/core/test/credential-codex-sync.test.ts: 13/13 pass, tsgo typecheck clean.
  • New regression test "syncs the instance-door credential whose account matches the auth file" fails on the unpatched source (12 pass / 1 fail) and passes with the fix.
  • New safety test: a file for account A never modifies account B's credential (reports no-credential).

Live state (already cured by hand, ahead of this PR)

The exact update this sync performs was applied directly to the store on 2026-11-09 ~23:26Z (stored access/refresh now equal the Muse file's; true expiry 2026-11-19T02:49Z). Proof:

  • opencode quota --json: openai.main ok: true with real usage windows (was "Session expired").
  • Quota gatherer tick 2026-11-09T23:30:01Z: heartbeat openai.main state ok.
  • Server log: zero "token is expired" session-warm failures after the write.
  • Direct pinned run openai.main/gpt-6-luna now returns "The usage limit has been reached" — the weekly window is 100% until Fri 2026-11-13 08:28 CST — instead of the auth-expired error. The credential is accepted; only the ordinary quota wall remains, and the route fails over to other legs meanwhile (live sessions verified answering).

Deploy remainder

Merging this PR is not the deploy. Still needed, via the normal path: bump the opencode pin in developing-today/code, build, and switch the laptop generation. Deadline: the hand-synced stored token expires 2026-11-19T02:49Z — if this fix is not deployed by then and the store has again drifted from the CLI file, the auth wall returns.

Refs #1154, developing-today/code#7991.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
fix(core): sync Codex tokens to the account's instance-door credential
1b1d8e3
CodexSync listed credentials only under the base `openai` integration and
silently reported no-credential when none was there. Deployed configurations
keep the ChatGPT credentials on instance doors (`openai.main`,
`openai.alternate`), so the sync never ran: the stored openai.main token
expired 2026-11-09 and every workhorse session start failed with
"Provided authentication token is expired" (developing-today/code#7991).

Select the sync target by the auth file's account ID across the base
integration and its instance doors, falling back to the base integration's
selected credential when the file carries no account match. One account's
tokens are never written into another account's credential.

Refs #1154.
@dezren39 dezren39 mentioned this pull request Nov 9, 2026
Fleet-stalling: workhorse route auth token expired (42 sessions failed); prompt probe returns 'Insufficient account balance' developing-today/code#7991
Closed
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit ff9858a into main Nov 9, 2026
1 check failed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the fix/7991-codex-sync-target branch November 9, 2026 23:32
This was referenced Nov 9, 2026
chore(nix): bump opencode pin to ff9858ae — codex sync instance-door fix (#7991) developing-today/code#8067
Merged
fix(core): Codex credential sync never targets the self-contained _openai door (code#8163) #2250
Merged
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.