{"record":{"id":"07adfdaedde0d24e","repo":"stablyai/orca","slug":"no-codex-credentials-found-in-resolve-trimmed","errorCode":null,"errorMessage":"No Codex credentials found in ${resolve(trimmed)}. Run `codex login` into this directory first.","messagePattern":"No Codex credentials found in (.+?)\\. Run `codex login` into this directory first\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/codex-accounts/service.ts","lineNumber":768,"sourceCode":"      throw error\n    }\n  }\n\n  // Why: copy the auth.json from an already-authenticated CODEX_HOME (e.g. a temp\n  // dir the CLI ran `codex login` into) into the managed home. Mirrors the login\n  // step of doAddAccount without spawning an interactive browser flow.\n  private importCodexAuthFromHome(\n    sourceHome: string,\n    managedHomePath: string,\n    accountId: string\n  ): void {\n    const trimmed = sourceHome.trim()\n    if (!trimmed) {\n      throw new Error('A Codex home directory path is required.')\n    }\n    const authPath = join(resolve(trimmed), 'auth.json')\n    if (!existsSync(authPath)) {\n      throw new Error(\n        `No Codex credentials found in ${resolve(trimmed)}. Run \\`codex login\\` into this directory first.`\n      )\n    }\n    const trustedHome = this.assertManagedHomePath(managedHomePath, accountId)\n    writeFileAtomically(join(trustedHome, 'auth.json'), readFileSync(authPath, 'utf-8'), {\n      mode: 0o600\n    })\n  }\n\n  private async persistCapturedCodexAccount(\n    accountId: string,\n    managedHome: ManagedHomeLocation\n  ): Promise<CodexRateLimitAccountsState> {\n    const identity = this.readIdentityFromHome(managedHome.managedHomePath, accountId)\n    if (!identity.email) {\n      throw new Error('Codex login completed, but Orca could not resolve the account email.')\n    }\n","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/codex-accounts/service.ts#L750-L786","documentation":"Thrown by importCodexAuthFromHome when sourceHome resolves to a real directory but that directory contains no auth.json file. The import flow copies credentials from a pre-authenticated CODEX_HOME, so the source must have already completed `codex login`.","triggerScenarios":"addAccountFromHome is called with a path that exists but has no auth.json — i.e. `codex login` was never run into that directory, or was run with a different CODEX_HOME.","commonSituations":"User points the CLI import at the wrong directory (e.g. the repo root instead of the temp CODEX_HOME), or ran `codex login` with default HOME so credentials landed in ~/.codex instead of the specified dir.","solutions":["Run `codex login` with CODEX_HOME explicitly set to the directory you pass to addAccountFromHome, then retry.","Point addAccountFromHome at the directory that actually contains auth.json (often ~/.codex for a default login).","If you want Orca to drive the browser login itself, use addAccount() instead of the import path."],"exampleFix":"# before: login ran into default HOME, import points elsewhere\nCODEX_HOME=/tmp/empty codex login   # creds go to ~/.codex, not /tmp/empty\norca account add --agent codex --from-home /tmp/empty  # throws [909]\n\n# after: log in INTO the directory you import\nCODEX_HOME=/tmp/codex-home codex login\norca account add --agent codex --from-home /tmp/codex-home","handlingStrategy":"validation","validationCode":"// Confirm auth.json exists in the source home before importing.\nimport { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nconst authPath = resolve(sourceHome.trim(), 'auth.json')\nif (!existsSync(authPath)) {\n  throw new Error(`Run \\`codex login\\` into ${resolve(sourceHome.trim())} first.`)\n}\nawait service.addAccountFromHome(sourceHome, target)","typeGuard":null,"tryCatchPattern":"try {\n  await service.addAccountFromHome(sourceHome, target)\n} catch (error) {\n  if (error instanceof Error && error.message.startsWith('No Codex credentials found')) {\n    // instruct: run `CODEX_HOME=<dir> codex login` then retry\n  } else throw error\n}","preventionTips":["Run `codex login` with CODEX_HOME set to the exact directory you import.","Verify auth.json is present in the source home before calling addAccountFromHome."],"tags":["codex-accounts","import","auth","missing-file","codex-login"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}