@@ -760,7 +760,12 @@ const makePendingCodexProvider = Effect.fn("CodexProvider.makePendingCodexProvid
760760 } ) ;
761761} ) ;
762762
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+ ) : {
764769 readonly status : Exclude < ServerProviderState , "disabled" > ;
765770 readonly auth : ServerProvider [ "auth" ] ;
766771 readonly message ?: string ;
@@ -788,7 +793,9 @@ function accountProbeStatus({ account, rateLimits }: CodexAppServerProviderSnaps
788793 return {
789794 status : "error" ,
790795 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." ,
792799 } ;
793800 }
794801
@@ -903,7 +910,12 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
903910 const snapshot = probeResult . success . value ;
904911 const accountStatus = managedAuth
905912 ? { 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+ ) ;
907919 // Sign-in guidance still applies when Codex itself says it needs an OpenAI login.
908920 const usageLimits =
909921 ! snapshot . nativeUsage && ! accountStatus . message
0 commit comments