Unable to login with zen provider. #2215

Open
opened 2026-02-16 17:34:42 -05:00 by yindo · 12 comments
Owner

Originally created by @Simpaqt on GitHub (Oct 21, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Whenever i try to login with opencode zen (recommended) it freezes entirely.

if i run

opencode auth login zen

This is my result:

┌  Add credential
Error: Unexpected error, check log file at /home/simpa/.local/share/opencode/log/2025-10-21T180236.log for more details

113003 |       directory: process.cwd(),
113004 |       async fn() {
113005 |         UI2.empty();
113006 |         Ge("Add credential");
113007 |         if (args2.url) {
113008 |           const wellknown = await fetch(`${args2.url}/.well-known/opencode`).then((x3) => x3.json());
         ^
TypeError: fetch() URL is invalid
 code: "ERR_INVALID_URL"

      at fetch (unknown:1:1)
      at fn (/$bunfs/root/index.js:113008:40)
      at fn (/$bunfs/root/index.js:113004:22)
      at processTicksAndRejections (native:7:39)

Logfile:

INFO  2025-10-21T18:02:36 +120ms service=default version=0.15.12 args=["auth","login","zen"] opencode
INFO  2025-10-21T18:02:36 +0ms service=project directory=/home/simpa fromDirectory
ERROR 2025-10-21T18:02:36 +15ms service=default name=TypeError message=fetch() URL is invalid stack=TypeError: fetch() URL is invalid
    at fetch (unknown)
    at fn (/$bunfs/root/index.js:113008:40)
    at fn (/$bunfs/root/index.js:113004:22)
    at processTicksAndRejections (native:7:39) fatal

Seems to be an invalid URL or I am an idiot unable to get it working. :D

Some guidance would be nice

OpenCode version

0.15.12

Steps to reproduce

  • opencode auth login zen

Screenshot and/or share link

No response

Operating System

Arch Linux 6.17.2-zen1-1-zen

Terminal

Ghostty

Originally created by @Simpaqt on GitHub (Oct 21, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Whenever i try to login with opencode zen (recommended) it freezes entirely. if i run ``` opencode auth login zen ``` This is my result: ``` ┌ Add credential Error: Unexpected error, check log file at /home/simpa/.local/share/opencode/log/2025-10-21T180236.log for more details 113003 | directory: process.cwd(), 113004 | async fn() { 113005 | UI2.empty(); 113006 | Ge("Add credential"); 113007 | if (args2.url) { 113008 | const wellknown = await fetch(`${args2.url}/.well-known/opencode`).then((x3) => x3.json()); ^ TypeError: fetch() URL is invalid code: "ERR_INVALID_URL" at fetch (unknown:1:1) at fn (/$bunfs/root/index.js:113008:40) at fn (/$bunfs/root/index.js:113004:22) at processTicksAndRejections (native:7:39) ``` Logfile: ``` INFO 2025-10-21T18:02:36 +120ms service=default version=0.15.12 args=["auth","login","zen"] opencode INFO 2025-10-21T18:02:36 +0ms service=project directory=/home/simpa fromDirectory ERROR 2025-10-21T18:02:36 +15ms service=default name=TypeError message=fetch() URL is invalid stack=TypeError: fetch() URL is invalid at fetch (unknown) at fn (/$bunfs/root/index.js:113008:40) at fn (/$bunfs/root/index.js:113004:22) at processTicksAndRejections (native:7:39) fatal ``` Seems to be an invalid URL or I am an idiot unable to get it working. :D Some guidance would be nice ### OpenCode version 0.15.12 ### Steps to reproduce - opencode auth login zen ### Screenshot and/or share link _No response_ ### Operating System Arch Linux 6.17.2-zen1-1-zen ### Terminal Ghostty
yindo added the bugzen labels 2026-02-16 17:34:42 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 21, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3082: Similar authentication issues with zen provider where the program gets stuck during initialization and authentication process

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 21, 2025): This issue might be a duplicate of existing issues. Please check: - #3082: Similar authentication issues with zen provider where the program gets stuck during initialization and authentication process Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

@Simpaqt it is interactive so you need to do this (im using bun x opencode-ai@latest for you that's just opencode:

Image Image

Then enter your key and hit submit

@rekram1-node commented on GitHub (Oct 21, 2025): @Simpaqt it is interactive so you need to do this (im using `bun x opencode-ai@latest` for you that's just `opencode`: <img width="565" height="316" alt="Image" src="https://github.com/user-attachments/assets/05e07c58-638a-4946-a9a0-2d38a88e30a8" /> <img width="516" height="266" alt="Image" src="https://github.com/user-attachments/assets/2c3e72a0-9219-4172-b5ec-c44b7a5d8bf6" /> Then enter your key and hit submit
Author
Owner

@Simpaqt commented on GitHub (Oct 21, 2025):

@Simpaqt it is interactive so you need to do this (im using bun x opencode-ai@latest for you that's just opencode:

Image Image
Then enter your key and hit submit

I see, well bun doesnt work for me. Not sure what the issue is with it but its stuck on resolve and never moves.

As for opencode auth login. It doesnt move past this point.

Image
@Simpaqt commented on GitHub (Oct 21, 2025): > [@Simpaqt](https://github.com/Simpaqt) it is interactive so you need to do this (im using `bun x opencode-ai@latest` for you that's just `opencode`: > > <img alt="Image" width="565" height="316" src="https://private-user-images.githubusercontent.com/63023139/503830906-05e07c58-638a-4946-a9a0-2d38a88e30a8.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjEwNzU0NDIsIm5iZiI6MTc2MTA3NTE0MiwicGF0aCI6Ii82MzAyMzEzOS81MDM4MzA5MDYtMDVlMDdjNTgtNjM4YS00OTQ2LWE5YTAtMmQzOGE4OGUzMGE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDIxVDE5MzIyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5N2Y4ODQzNTg0NjUyNjM1Y2NjODZlMTIwMmU5NzIzMDZiMDhlZmIxOTc4NWE3NWNkNzZkNDExNGZmMjU4YWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HCrdHjkdKCBNPkKZDRGtQhIOnKhSBYvTC2hCMAdhXKQ"> <img alt="Image" width="516" height="266" src="https://private-user-images.githubusercontent.com/63023139/503830942-2c3e72a0-9219-4172-b5ec-c44b7a5d8bf6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjEwNzU0NDIsIm5iZiI6MTc2MTA3NTE0MiwicGF0aCI6Ii82MzAyMzEzOS81MDM4MzA5NDItMmMzZTcyYTAtOTIxOS00MTcyLWI1ZWMtYzQ0YjdhNWQ4YmY2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDIxVDE5MzIyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2NzcwYzkyNDQ5ZjlkMjdjNGRmYWU2NjYxMGMyYmRhODk4MDQ5ZjI1YjNmNDdiOWE1NGZkY2ZhMzI3ZGUzNmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Plf-5iItwkkcj39owhqT5MP5suavhmc6XZarW5MwI8k"> > Then enter your key and hit submit I see, well bun doesnt work for me. Not sure what the issue is with it but its stuck on resolve and never moves. As for opencode auth login. It doesnt move past this point. <img width="365" height="298" alt="Image" src="https://github.com/user-attachments/assets/edd6a3e3-bec4-4067-98de-8159bec8ae1d" />
Author
Owner

@Simpaqt commented on GitHub (Oct 21, 2025):

Here are the --print-logs version

~ took 1m58s
❯ opencode auth login --print-logs
INFO  2025-10-21T19:35:02 +118ms service=default version=0.15.12 args=["auth","login","--print-logs"] opencode
INFO  2025-10-21T19:35:02 +0ms service=project directory=/home/simpa fromDirectory

┌  Add credential
INFO  2025-10-21T19:35:02 +4ms service=models.dev file={} refreshing
INFO  2025-10-21T19:35:03 +1119ms service=models.dev file={} refreshing
│
◇  Select provider
│  OpenCode Zen
INFO  2025-10-21T19:35:05 +1444ms service=config path=/home/simpa/.config/opencode/config.json loading
INFO  2025-10-21T19:35:05 +1ms service=config path=/home/simpa/.config/opencode/opencode.json loading
INFO  2025-10-21T19:35:05 +0ms service=config path=/home/simpa/.config/opencode/opencode.jsonc loading
INFO  2025-10-21T19:35:05 +4ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@0.15.12","--exact"] cwd=/home/simpa/.config/opencode running
INFO  2025-10-21T19:35:05 +2ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
INFO  2025-10-21T19:35:05 +1ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution
INFO  2025-10-21T19:35:05 +0ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/simpa/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/home/simpa/.cache/opencode running
@Simpaqt commented on GitHub (Oct 21, 2025): Here are the --print-logs version ``` ~ took 1m58s ❯ opencode auth login --print-logs INFO 2025-10-21T19:35:02 +118ms service=default version=0.15.12 args=["auth","login","--print-logs"] opencode INFO 2025-10-21T19:35:02 +0ms service=project directory=/home/simpa fromDirectory ┌ Add credential INFO 2025-10-21T19:35:02 +4ms service=models.dev file={} refreshing INFO 2025-10-21T19:35:03 +1119ms service=models.dev file={} refreshing │ ◇ Select provider │ OpenCode Zen INFO 2025-10-21T19:35:05 +1444ms service=config path=/home/simpa/.config/opencode/config.json loading INFO 2025-10-21T19:35:05 +1ms service=config path=/home/simpa/.config/opencode/opencode.json loading INFO 2025-10-21T19:35:05 +0ms service=config path=/home/simpa/.config/opencode/opencode.jsonc loading INFO 2025-10-21T19:35:05 +4ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@0.15.12","--exact"] cwd=/home/simpa/.config/opencode running INFO 2025-10-21T19:35:05 +2ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin INFO 2025-10-21T19:35:05 +1ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution INFO 2025-10-21T19:35:05 +0ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/simpa/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/home/simpa/.cache/opencode running ```
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

@Simpaqt what kind of network speed do you have this could be issue with installing the necessary provider packages.

It looks like it is downloading from npm but it is stuck on that download.

If you let it run it should resolve, for me it takes less than a second but depending on ur network it could take longer

@rekram1-node commented on GitHub (Oct 21, 2025): @Simpaqt what kind of network speed do you have this could be issue with installing the necessary provider packages. It looks like it is downloading from npm but it is stuck on that download. If you let it run it should resolve, for me it takes less than a second but depending on ur network it could take longer
Author
Owner

@Simpaqt commented on GitHub (Oct 21, 2025):

I would say i have a decent enough connection..

Image
@Simpaqt commented on GitHub (Oct 21, 2025): I would say i have a decent enough connection.. <img width="858" height="108" alt="Image" src="https://github.com/user-attachments/assets/4c1f4be9-46cf-4f90-b53e-3e6a33f5cd2a" />
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

i guess what happens if you just let it play out?

@rekram1-node commented on GitHub (Oct 21, 2025): i guess what happens if you just let it play out?
Author
Owner

@Simpaqt commented on GitHub (Oct 21, 2025):

@rekram1-node well it moved a bit.

this is what is showing currently

~ took 1m58s
❯ opencode auth login --print-logs
INFO  2025-10-21T19:35:02 +118ms service=default version=0.15.12 args=["auth","login","--print-logs"] opencode
INFO  2025-10-21T19:35:02 +0ms service=project directory=/home/simpa fromDirectory

┌  Add credential
INFO  2025-10-21T19:35:02 +4ms service=models.dev file={} refreshing
INFO  2025-10-21T19:35:03 +1119ms service=models.dev file={} refreshing
│
◇  Select provider
│  OpenCode Zen
INFO  2025-10-21T19:35:05 +1444ms service=config path=/home/simpa/.config/opencode/config.json loading
INFO  2025-10-21T19:35:05 +1ms service=config path=/home/simpa/.config/opencode/opencode.json loading
INFO  2025-10-21T19:35:05 +0ms service=config path=/home/simpa/.config/opencode/opencode.jsonc loading
INFO  2025-10-21T19:35:05 +4ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@0.15.12","--exact"] cwd=/home/simpa/.config/opencode running
INFO  2025-10-21T19:35:05 +2ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
INFO  2025-10-21T19:35:05 +1ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution
INFO  2025-10-21T19:35:05 +0ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/simpa/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/home/simpa/.cache/opencode running
INFO  2025-10-21T19:46:20 +675138ms service=bun code=0 stdout=bun add v1.3.0 (b0a6feca)

installed opencode-copilot-auth@0.0.3

1 package installed [675.13s]
 stderr=Resolving dependencies
Resolved, downloaded and extracted [4]
Saved lockfile
 done
INFO  2025-10-21T19:46:20 +3ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
INFO  2025-10-21T19:46:20 +2ms service=bun pkg=opencode-anthropic-auth version=0.0.2 installing package using Bun's default registry resolution
INFO  2025-10-21T19:46:20 +0ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/simpa/.cache/opencode","opencode-anthropic-auth@0.0.2"] cwd=/home/simpa/.cache/opencode running
@Simpaqt commented on GitHub (Oct 21, 2025): @rekram1-node well it moved a bit. this is what is showing currently ``` ~ took 1m58s ❯ opencode auth login --print-logs INFO 2025-10-21T19:35:02 +118ms service=default version=0.15.12 args=["auth","login","--print-logs"] opencode INFO 2025-10-21T19:35:02 +0ms service=project directory=/home/simpa fromDirectory ┌ Add credential INFO 2025-10-21T19:35:02 +4ms service=models.dev file={} refreshing INFO 2025-10-21T19:35:03 +1119ms service=models.dev file={} refreshing │ ◇ Select provider │ OpenCode Zen INFO 2025-10-21T19:35:05 +1444ms service=config path=/home/simpa/.config/opencode/config.json loading INFO 2025-10-21T19:35:05 +1ms service=config path=/home/simpa/.config/opencode/opencode.json loading INFO 2025-10-21T19:35:05 +0ms service=config path=/home/simpa/.config/opencode/opencode.jsonc loading INFO 2025-10-21T19:35:05 +4ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@0.15.12","--exact"] cwd=/home/simpa/.config/opencode running INFO 2025-10-21T19:35:05 +2ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin INFO 2025-10-21T19:35:05 +1ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution INFO 2025-10-21T19:35:05 +0ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/simpa/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/home/simpa/.cache/opencode running INFO 2025-10-21T19:46:20 +675138ms service=bun code=0 stdout=bun add v1.3.0 (b0a6feca) installed opencode-copilot-auth@0.0.3 1 package installed [675.13s] stderr=Resolving dependencies Resolved, downloaded and extracted [4] Saved lockfile done INFO 2025-10-21T19:46:20 +3ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin INFO 2025-10-21T19:46:20 +2ms service=bun pkg=opencode-anthropic-auth version=0.0.2 installing package using Bun's default registry resolution INFO 2025-10-21T19:46:20 +0ms service=bun cmd=["/home/simpa/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/simpa/.cache/opencode","opencode-anthropic-auth@0.0.2"] cwd=/home/simpa/.cache/opencode running ```
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

I guess it's just taking it's time for whatever reason, we should probably add some visual indicator at some point

@rekram1-node commented on GitHub (Oct 21, 2025): I guess it's just taking it's time for whatever reason, we should probably add some visual indicator at some point
Author
Owner

@Simpaqt commented on GitHub (Oct 21, 2025):

To be fair, i have had major issues with bun. But i'll just leave it running to see what happens.

@Simpaqt commented on GitHub (Oct 21, 2025): To be fair, i have had major issues with bun. But i'll just leave it running to see what happens.
Author
Owner

@Eric-Guo commented on GitHub (Nov 7, 2025):

I meet the same problm and the solution is using A modern terminal emulator (MacOS Terminal is not) or enter tmux first.

@Eric-Guo commented on GitHub (Nov 7, 2025): I meet the same problm and the solution is using `A modern terminal emulator` (MacOS Terminal is not) or enter `tmux` first.
Author
Owner

@greeze commented on GitHub (Nov 22, 2025):

I had the same problem and was able to solve it by disabling IPv6 in my environment (I'm on ChromeOS and my linux environment isn't playing nice with IPv6). This appears to be a common problem with bun, and isn't OpenCode-related.

@greeze commented on GitHub (Nov 22, 2025): I had the same problem and was able to solve it by disabling IPv6 in my environment (I'm on ChromeOS and my linux environment isn't playing nice with IPv6). This appears to be a common problem with bun, and isn't OpenCode-related.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2215