{"record":{"id":"2efaf302c742e41a","repo":"paperclipai/paperclip","slug":"no-codex-credentials-provisioned-for-managed-home-2efaf3","errorCode":null,"errorMessage":"no Codex credentials provisioned for managed home \"${input.effectiveCodexHome}\" (no usable auth.json and OPENAI_API_KEY is empty). Sign in to Codex on the host with a ChatGPT subscription, or configure a per-agent OPENAI_API_KEY.","messagePattern":"no Codex credentials provisioned for managed home \"(.+?)\" \\(no usable auth\\.json and OPENAI_API_KEY is empty\\)\\. Sign in to Codex on the host with a ChatGPT subscription, or configure a per-agent OPENAI_API_KEY\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapters/codex-local/src/server/execute.ts","lineNumber":408,"sourceCode":"      // sandbox lacks a login — proceeding lets a genuinely credentialed\n      // sandbox run, and a credential-less one still fails at Codex's first\n      // request with the provider's own error.\n      await input.onLog(\n        \"stderr\",\n        `Could not verify the sandbox's Codex login (probe failed); proceeding. ` +\n          `If the sandbox has no credentials, Codex will fail at its first request.\\n`,\n      );\n      return;\n    }\n    throw new Error(\n      `no Codex credentials provisioned for managed home \"${input.effectiveCodexHome}\" ` +\n        `(no usable auth.json, OPENAI_API_KEY is empty, and the sandbox has no Codex login). ` +\n        `Use a sandbox image that is signed in to Codex, configure a per-agent OPENAI_API_KEY, ` +\n        `or sign in to Codex on the host with a ChatGPT subscription.`,\n    );\n  }\n\n  throw new Error(\n    `no Codex credentials provisioned for managed home \"${input.effectiveCodexHome}\" ` +\n      `(no usable auth.json and OPENAI_API_KEY is empty). ` +\n      `Sign in to Codex on the host with a ChatGPT subscription, or configure a per-agent ` +\n      `OPENAI_API_KEY.`,\n  );\n}\n\nasync function emitSandboxAuthPrecedenceWarningIfNeeded(input: {\n  runId: string;\n  target: MaybeResolvedExecutionTarget;\n  cwd: string;\n  configuredApiKey: boolean;\n  hostAuthJson: boolean;\n  onLog: AdapterExecutionContext[\"onLog\"];\n  onEvent: AdapterExecutionContext[\"onEvent\"];\n}): Promise<void> {\n  if (!input.target || input.target.kind !== \"remote\" || input.target.transport !== \"sandbox\") {\n    return;","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapters/codex-local/src/server/execute.ts#L390-L426","documentation":"Thrown by ensureCodexCredentialsProvisioned for a NON-sandbox target (the else branch at execute.ts:408). It fires when the managed Codex home is not ready and the target is not a sandbox, so there is no sandbox login to fall back on. The message is shorter than 384 because there is no third (sandbox) remediation path.","triggerScenarios":"evaluateCodexCredentialReadiness returns { managed: true, ready: false } AND the target is NOT (kind===\"remote\" && transport===\"sandbox\") — i.e. a local/remote-non-sandbox run.","commonSituations":"Local Codex run on a machine where the user never ran `codex login` and OPENAI_API_KEY is unset; the managed home auth.json was deleted or expired and the subscription login was not refreshed.","solutions":["Run `codex login` on the host with a ChatGPT subscription to populate the managed home auth.json.","Set a per-agent OPENAI_API_KEY env var for the run.","If using a shared/team key, configure it in the agent's env block rather than relying on a host login."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function localCodexReady(env: NodeJS.ProcessEnv, authJsonExists: boolean): boolean {\n  return authJsonExists || Boolean(env.OPENAI_API_KEY && env.OPENAI_API_KEY.trim());\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ensureCodexCredentialsProvisioned(input);\n} catch (e) {\n  if (e instanceof Error && /no Codex credentials provisioned/.test(e.message)) {\n    // prompt operator to run `codex login` or set OPENAI_API_KEY; non-retryable config error\n  }\n  throw e;\n}","preventionTips":["Run `codex login` on hosts that execute Codex locally.","Set OPENAI_API_KEY per-agent as a durable fallback.","Monitor managed home auth.json freshness; alert when last_refresh is stale."],"tags":["codex","credentials","auth","configuration","local"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}