{"record":{"id":"0952df32b58c1a22","repo":"stablyai/orca","slug":"the-selected-codex-account-credentials-are-tempora","errorCode":null,"errorMessage":"The selected Codex account credentials are temporarily unavailable. Try opening the terminal again.","messagePattern":"The selected Codex account credentials are temporarily unavailable\\. Try opening the terminal again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/main/ipc/pty.ts","lineNumber":1384,"sourceCode":"      codexHomePath: selectedCodexHomePath,\n      settings: args.getSettings(),\n      target: args.target\n    })\n    if (!nextReadiness) {\n      return selectedCodexHomePath\n    }\n    readiness = nextReadiness\n  }\n  if (\n    isCodexHomeAuthReadyForLaunch({\n      codexHomePath: selectedCodexHomePath,\n      settings: args.getSettings(),\n      target: args.target\n    })\n  ) {\n    return selectedCodexHomePath\n  }\n  throw new Error(MANAGED_CODEX_AUTH_UNAVAILABLE_MESSAGE)\n}\n\nfunction codexHomeSelectionsEqual(left: string | null, right: string | null): boolean {\n  return (\n    left === right ||\n    (left !== null &&\n      right !== null &&\n      normalizeRuntimePathForComparison(left) === normalizeRuntimePathForComparison(right))\n  )\n}\n\nfunction codexHomePathsEqual(left: string | null, right: string): boolean {\n  return codexHomeSelectionsEqual(left, right)\n}\n\n// Why: CODEX_HOME is fixed in a shell's environment at spawn and the daemon\n// keeps that shell alive across app restarts, so the launch account is the only\n// way to tell later that a pane still runs Codex as the previously selected","sourceCodeStart":1366,"sourceCodeEnd":1402,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/pty.ts#L1366-L1402","documentation":"Distinct from 1261/1262: 'selected' (not 'session'). Thrown at the end of continueCodexHomeAfterManagedAuthWait when no requiredCodexHomePath pins a session, but after two readiness attempts the final isCodexHomeAuthReadyForLaunch check on the currently selected managed home still returns false. This guards a fresh launch (not a resume) when the selected account's credential never materialized.","triggerScenarios":"Starting a new Codex terminal against a managed host home whose auth.json is not launch-ready: no OPENAI_API_KEY for apikey mode, missing token triple for chatgpt mode, missing agent_runtime_id/agent_private_key for agentIdentity mode, missing api_key for bedrock, etc. The two-pass wait plus final check all failed.","commonSituations":"Adding a managed account but never completing sign-in; account whose token set expired and background refresh is stuck; corrupted auth.json that parses but yields 'no-credential' state; switching selected account mid-launch to one that has not finished provisioning.","solutions":["Retry the launch — the readiness window is short and most credentials settle within a few seconds.","Open Settings > Codex managed accounts and re-authenticate the selected account so auth.json is regenerated with a complete credential.","Switch to a different managed account or to an API-key config that does not depend on the managed auth file.","If on Windows, ensure no other process holds auth.json open during rotation."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import { isCodexHomeAuthReadyForLaunch } from '../codex-accounts/managed-codex-auth-readiness'\n\n// before spawning a fresh Codex terminal\nif (!isCodexHomeAuthReadyForLaunch({ codexHomePath: selected, settings, target })) {\n  await waitForManagedCodexAuthReady({ codexHomePath: selected, settings, target })\n}","typeGuard":"function isManagedCodexAuthUnavailable(err: unknown): boolean {\n  return (\n    err instanceof Error &&\n    err.message === 'The selected Codex account credentials are temporarily unavailable. Try opening the terminal again.'\n  )\n}","tryCatchPattern":"try {\n  await launchCodex(args)\n} catch (err) {\n  if (isManagedCodexAuthUnavailable(err)) {\n    surfaceTransient('Codex credentials not ready — please reopen the terminal.')\n    return\n  }\n  throw err\n}","preventionTips":["Complete managed-account sign-in before first launch (auth.json must contain a full credential for the declared auth_mode).","Don't switch selected managed account mid-launch.","If using ChatGPT mode, ensure all of access_token, id_token, and refresh_token are present — partial tokens count as incomplete."],"tags":["codex","auth","managed-account","launch","readiness","credential-state"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}