diff --git a/packages/adapters/codex-local/src/server/test.ts b/packages/adapters/codex-local/src/server/test.ts index 292e53ee..fbf95e62 100644 --- a/packages/adapters/codex-local/src/server/test.ts +++ b/packages/adapters/codex-local/src/server/test.ts @@ -15,6 +15,7 @@ import { } from "@paperclipai/adapter-utils/server-utils"; import path from "node:path"; import { parseCodexJsonl } from "./parse.js"; +import { readCodexAuthInfo } from "./quota.js"; function summarizeStatus(checks: AdapterEnvironmentCheck[]): AdapterEnvironmentTestResult["status"] { if (checks.some((check) => check.level === "error")) return "fail"; @@ -108,12 +109,22 @@ export async function testEnvironment( detail: `Detected in ${source}.`, }); } else { - checks.push({ - code: "codex_openai_api_key_missing", - level: "warn", - message: "OPENAI_API_KEY is not set. Codex runs may fail until authentication is configured.", - hint: "Set OPENAI_API_KEY in adapter env, shell environment, or Codex auth configuration.", - }); + const codexAuth = await readCodexAuthInfo().catch(() => null); + if (codexAuth) { + checks.push({ + code: "codex_native_auth_present", + level: "info", + message: "Codex is authenticated via its own auth configuration.", + detail: codexAuth.email ? `Logged in as ${codexAuth.email}.` : "Credentials found in ~/.codex/auth.json.", + }); + } else { + checks.push({ + code: "codex_openai_api_key_missing", + level: "warn", + message: "OPENAI_API_KEY is not set. Codex runs may fail until authentication is configured.", + hint: "Set OPENAI_API_KEY in adapter env, shell environment, or run `codex auth` to log in.", + }); + } } const canRunProbe =