Skip to content

Keep login waiting when the browser cannot be opened - #90

Open
Chebaleomkar wants to merge 1 commit into
supermemoryai:mainfrom
Chebaleomkar:fix/auth-browser-open-fallback
Open

Chebaleomkar wants to merge 1 commit into
supermemoryai:mainfrom
Chebaleomkar:fix/auth-browser-open-fallback

Conversation

@Chebaleomkar

Copy link
Copy Markdown
Contributor

Fixes #72

Problem: On systems without a browser opener (e.g. WSL with no xdg-open), login prints "If it doesn't open, visit: " and then immediately exits with Failed to open browser: spawn xdg-open ENOENT, so the printed URL can't be used.

Fix: A failed browser launch is no longer fatal. The CLI logs the error and keeps the callback server listening until the existing auth timeout, so the user can open the URL manually.

Testing:

  • Added src/services/auth.test.ts, which fails on main (callback server already closed) and passes with this change.
  • Reproduced Running pnpm dlx opencode-supermemory@latest login in WSL will result in an error #72 in WSL2 Ubuntu 24.04 without xdg-open. With the fix, the callback succeeded both from inside WSL and from Windows via localhost forwarding (the path a user takes when opening the URL in their Windows browser).
  • bun run typecheck and bun test (34 pass) are clean.

If xdg-open/open fails (e.g. WSL without a browser handler), the auth
flow aborted even though it had just printed the URL to visit manually.
Log the failure and keep the callback server listening until the
existing timeout instead.

Fixes supermemoryai#72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running pnpm dlx opencode-supermemory@latest login in WSL will result in an error

1 participant