@devries-cameron20 / t3code Mirror · read-only / commits / 09e1751a16
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 19:45 UTC

fix(server): Codex sign-in hint names the instance's CODEX_HOME (#35004)

Julius Marminge committed Nov 12, 2026 at 02:28 UTC 09e1751a16421268874278920c6f403ade4e1a42
2 files changed +34 -3
apps/server/src/provider/CodexProvider.ts
+15 -3
@@ -760,7 +760,12 @@ const makePendingCodexProvider = Effect.fn("CodexProvider.makePendingCodexProvid
760 });
761 });
762
763 -function accountProbeStatus({ account, rateLimits }: CodexAppServerProviderSnapshot): {
763 +const quotePath = Schema.encodeSync(Schema.fromJsonString(Schema.String));
764 +
765 +function accountProbeStatus(
766 + { account, rateLimits }: CodexAppServerProviderSnapshot,
767 + codexHome: string | undefined,
768 +): {
769 readonly status: Exclude<ServerProviderState, "disabled">;
770 readonly auth: ServerProvider["auth"];
771 readonly message?: string;
@@ -788,7 +793,9 @@ function accountProbeStatus({ account, rateLimits }: CodexAppServerProviderSnaps
793 return {
794 status: "error",
795 auth: { status: "unauthenticated" },
791 - message: "Codex CLI is not authenticated. Run `codex login` and try again.",
796 + message: codexHome
797 + ? `Codex CLI is not authenticated. Run \`codex login\` with CODEX_HOME set to ${quotePath(codexHome)} and try again.`
798 + : "Codex CLI is not authenticated. Run `codex login` and try again.",
799 };
800 }
801
@@ -903,7 +910,12 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
910 const snapshot = probeResult.success.value;
911 const accountStatus = managedAuth
912 ? { status: "ready" as const, auth: managedAuth, message: undefined }
906 - : accountProbeStatus(snapshot);
913 + : accountProbeStatus(
914 + snapshot,
915 + codexSettings.homePath
916 + ? expandHomePath(codexSettings.homePath, yield* HostProcess.HomeDirectory)
917 + : undefined,
918 + );
919 // Sign-in guidance still applies when Codex itself says it needs an OpenAI login.
920 const usageLimits =
921 !snapshot.nativeUsage && !accountStatus.message
apps/server/src/provider/ProviderRegistry.test.ts
+19
@@ -466,6 +466,25 @@ it.layer(
466 }),
467 );
468
469 + it.effect("names the instance's CODEX_HOME in the sign-in hint for a custom home", () =>
470 + Effect.gen(function* () {
471 + const homePath = "/srv/codex-work-home";
472 + const status = yield* checkCodexProviderStatus(
473 + decodeCodexSettings({ binaryPath: "codex", homePath }),
474 + () =>
475 + Effect.succeed(
476 + makeCodexProbeSnapshot({
477 + account: { account: null, requiresOpenaiAuth: true },
478 + }),
479 + ),
480 + );
481 +
482 + assert.strictEqual(status.auth.status, "unauthenticated");
483 + assert.include(status.message ?? "", "CODEX_HOME");
484 + assert.include(status.message ?? "", homePath);
485 + }),
486 + );
487 +
488 it.effect("returns ready with unknown auth when app-server does not require OpenAI auth", () =>
489 Effect.gen(function* () {
490 const status = yield* checkCodexProviderStatus(defaultCodexSettings, () =>