Summary
After running /supermemory-logout, the SessionStart hook still initiates the browser authentication flow on the next startup. This occurs because session-start.ts does not check the .logged-out marker before calling startAuthFlow().
Current behavior
/supermemory-logout creates the logout marker (~/.codex/supermemory/.logged-out), but on the next Codex startup (without SUPERMEMORY_CODEX_API_KEY), the SessionStart hook only checks .auth-attempted and proceeds to invoke startAuthFlow(), reopening the browser authentication flow.
The UserPromptSubmit recall hook already respects the .logged-out marker, making the behavior inconsistent across hooks.
Steps to reproduce
- Install and authenticate the plugin.
- Run
/supermemory-logout.
- Ensure
SUPERMEMORY_CODEX_API_KEY is not set.
- Restart Codex.
- Observe that the browser authentication flow is launched again.
Expected behavior
After logout, all automatic authentication attempts should be suppressed until the user explicitly runs /supermemory-login.
Root cause
In src/hooks/session-start.ts, the unauthenticated path checks only the .auth-attempted marker before calling startAuthFlow(). It does not check whether the user has explicitly logged out via the .logged-out marker.
Since the recall hook already checks the logout marker, the authentication logic is inconsistent.
Suggested fix
Update src/hooks/session-start.ts to check for the same .logged-out marker before invoking startAuthFlow(). Reusing the existing LOGGED_OUT_FILE constant (if available) would help keep the authentication behavior consistent across hooks.
Summary
After running
/supermemory-logout, theSessionStarthook still initiates the browser authentication flow on the next startup. This occurs becausesession-start.tsdoes not check the.logged-outmarker before callingstartAuthFlow().Current behavior
/supermemory-logoutcreates the logout marker (~/.codex/supermemory/.logged-out), but on the next Codex startup (withoutSUPERMEMORY_CODEX_API_KEY), theSessionStarthook only checks.auth-attemptedand proceeds to invokestartAuthFlow(), reopening the browser authentication flow.The
UserPromptSubmitrecall hook already respects the.logged-outmarker, making the behavior inconsistent across hooks.Steps to reproduce
/supermemory-logout.SUPERMEMORY_CODEX_API_KEYis not set.Expected behavior
After logout, all automatic authentication attempts should be suppressed until the user explicitly runs
/supermemory-login.Root cause
In
src/hooks/session-start.ts, the unauthenticated path checks only the.auth-attemptedmarker before callingstartAuthFlow(). It does not check whether the user has explicitly logged out via the.logged-outmarker.Since the recall hook already checks the logout marker, the authentication logic is inconsistent.
Suggested fix
Update
src/hooks/session-start.tsto check for the same.logged-outmarker before invokingstartAuthFlow(). Reusing the existingLOGGED_OUT_FILEconstant (if available) would help keep the authentication behavior consistent across hooks.