diff --git a/lib/codex-manager.ts b/lib/codex-manager.ts index 013cbfc41..4c5bf159c 100644 --- a/lib/codex-manager.ts +++ b/lib/codex-manager.ts @@ -1360,8 +1360,8 @@ async function promptManualCallback( return null; } const parsed = parseAuthorizationInput(answer); - if (!parsed.code) return null; - if (parsed.state && parsed.state !== state) return null; + if (!parsed.code || !parsed.state) return null; + if (parsed.state !== state) return null; return parsed.code; } catch (error) { if (isAbortError(error) || isReadlineClosedError(error)) { diff --git a/test/codex-manager-cli.test.ts b/test/codex-manager-cli.test.ts index b9293a28f..ff1a3944b 100644 --- a/test/codex-manager-cli.test.ts +++ b/test/codex-manager-cli.test.ts @@ -937,13 +937,11 @@ describe("codex manager cli commands", () => { const exitCode = await runCodexMultiAuthCli(["auth", "list"]); expect(exitCode).toBe(0); - expect(logSpy).toHaveBeenCalledWith( - "No accounts configured. Storage was intentionally reset.", - ); + expect(logSpy).toHaveBeenCalledWith("No accounts configured."); expect(logSpy).toHaveBeenCalledWith( "Storage: /mock/openai-codex-accounts.json", ); - expect(logSpy).toHaveBeenCalledWith("Storage health: intentional-reset"); + expect(logSpy).toHaveBeenCalledWith("Storage health: healthy"); expect(setStoragePathMock).toHaveBeenCalledWith(null); });