stablyai/orca · error · Error

That Codex rate limit account no longer exists.

Error message

That Codex rate limit account no longer exists.

What it means

Thrown by requireAccount, the single helper every account mutation uses to look up an account by ID. It scans settings.codexManagedAccounts and throws when no entry has the given id. Any operation on an account id that was removed (or never existed) hits this guard.

Source

Thrown at src/main/codex-accounts/service.ts:1105

    return {
      id: account.id,
      email: account.email,
      managedHomeRuntime: account.managedHomeRuntime ?? 'host',
      wslDistro: account.wslDistro ?? null,
      providerAccountId: account.providerAccountId ?? null,
      workspaceLabel: account.workspaceLabel ?? null,
      workspaceAccountId: account.workspaceAccountId ?? null,
      createdAt: account.createdAt,
      updatedAt: account.updatedAt,
      lastAuthenticatedAt: account.lastAuthenticatedAt
    }
  }

  private requireAccount(accountId: string): CodexManagedAccount {
    const settings = this.store.getSettings()
    const account = settings.codexManagedAccounts.find((entry) => entry.id === accountId)
    if (!account) {
      throw new Error('That Codex rate limit account no longer exists.')
    }
    return account
  }

  private normalizeActiveSelection(): void {
    const settings = this.store.getSettings()
    const selection = normalizeCodexRuntimeSelection(settings)
    const nextSelection = pruneInvalidCodexRuntimeSelection(
      selection,
      settings.codexManagedAccounts
    )
    const changed =
      nextSelection.host !== selection.host ||
      JSON.stringify(nextSelection.wsl) !== JSON.stringify(selection.wsl)
    if (changed) {
      this.store.updateSettings({
        activeCodexManagedAccountId: nextSelection.host,
        activeCodexManagedAccountIdsByRuntime: nextSelection

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Refresh the account list (listAccounts) before acting and drop stale ids.
  2. Guard the caller: check the id exists in listAccounts().accounts before invoking reauthenticate/remove/select.
  3. Treat a missing id as already-removed and no-op at the UI layer rather than erroring.

Example fix

// before: acting on an id that may be stale
service.removeAccount(accountId) // throws [913] if already gone

// after: existence-check first
const exists = service.listAccounts().accounts.some(a => a.id === accountId)
if (!exists) return { alreadyRemoved: true }
await service.removeAccount(accountId)
Defensive patterns

Strategy: validation

Validate before calling

// Existence-check before any account mutation.
const exists = service.listAccounts().accounts.some(a => a.id === accountId)
if (!exists) { return { status: 'not-found' } }
await service.reauthenticateAccount(accountId)

Type guard

const accountExists = (service: CodexAccountService, id: string): boolean =>
  service.listAccounts().accounts.some(a => a.id === id)

Try / catch

try {
  await service.removeAccount(accountId)
} catch (error) {
  if (error instanceof Error && error.message === 'That Codex rate limit account no longer exists.') {
    // already removed — treat as success
  } else throw error
}

Prevention

When it happens

Trigger: Calling reauthenticateAccount / removeAccount / selectAccount / selectAccountForTarget (or getPendingResetAttemptForAccount indirectly) with an accountId that is not present in the current settings.codexManagedAccounts.

Common situations: Stale account id held by the UI (account removed in another window or by sync), a race where the user removed an account between rendering the list and acting on it, or a hard-coded/incorrect id passed by an integration.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/34ff00466fa7b340. Report an issue: GitHub.