[Bug] Persistent ProviderInitError on Apple Silicon Mac Despite Clean Install #1938

Closed
opened 2026-02-16 17:33:19 -05:00 by yindo · 7 comments
Owner

Originally created by @manao29 on GitHub (Oct 3, 2025).

Originally assigned to: @rekram1-node on GitHub.

Hello, I am experiencing a persistent ProviderInitError when running opencode on my Apple Silicon Mac. The error occurs immediately upon sending the first message in the interface.

I have already gone through extensive troubleshooting, but the issue remains unchanged.

Error Message:

failed to send message: POST "http://127.0.0.1:xxxxx/session/..." 400 Bad Request
{"name":"ProviderInitError", "data":{"providerID":"opencode"}}
System Information:

macOS Version: (26.0.1)

Hardware: (arm64)

Node.js Version: v20.19.5 (managed by nvm)

npm Version: (10.8.2)

Troubleshooting Steps Performed:

I have tried all ofthe following steps, but the error persists in all scenarios:

Performed a complete wipe and re-installation multiple times (including deleting ~/.opencode and ~/.config/opencode directories and clearing npm cache).

Tested with both OpenAI and Zhipu AI providers. The result is the same.

Confirmed that I am not in a Conda environment.

Used nvm to switch from Node.js v22 to the stable LTS version v20.

Resolved potential .npmrc conflicts using nvm use --delete-prefix.

Given that the issue persists across different Node.js versions, providers, and after a complete re-installation outside of any Conda environment, this appears to be a bug related to the application's core initialization on an Apple Silicon (ARM64) macOS environment.

Image
Originally created by @manao29 on GitHub (Oct 3, 2025). Originally assigned to: @rekram1-node on GitHub. Hello, I am experiencing a persistent ProviderInitError when running opencode on my Apple Silicon Mac. The error occurs immediately upon sending the first message in the interface. I have already gone through extensive troubleshooting, but the issue remains unchanged. Error Message: failed to send message: POST "http://127.0.0.1:xxxxx/session/..." 400 Bad Request {"name":"ProviderInitError", "data":{"providerID":"opencode"}} System Information: macOS Version: (26.0.1) Hardware: (arm64) Node.js Version: v20.19.5 (managed by nvm) npm Version: (10.8.2) Troubleshooting Steps Performed: I have tried all ofthe following steps, but the error persists in all scenarios: Performed a complete wipe and re-installation multiple times (including deleting ~/.opencode and ~/.config/opencode directories and clearing npm cache). Tested with both OpenAI and Zhipu AI providers. The result is the same. Confirmed that I am not in a Conda environment. Used nvm to switch from Node.js v22 to the stable LTS version v20. Resolved potential .npmrc conflicts using nvm use --delete-prefix. Given that the issue persists across different Node.js versions, providers, and after a complete re-installation outside of any Conda environment, this appears to be a bug related to the application's core initialization on an Apple Silicon (ARM64) macOS environment. <img width="960" height="392" alt="Image" src="https://github.com/user-attachments/assets/824ac954-ea72-42c7-b4d1-d77ababb3557" />
yindo closed this issue 2026-02-16 17:33:19 -05:00
Author
Owner

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

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

  • #1635: Similar ProviderInitError with exact same error structure, though with Anthropic provider
  • #1659: SIGTRAP crashes on macOS 15.5 with Apple Silicon (arm64) - similar Apple Silicon compatibility issues

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

@github-actions[bot] commented on GitHub (Oct 3, 2025): This issue might be a duplicate of existing issues. Please check: - #1635: Similar ProviderInitError with exact same error structure, though with Anthropic provider - #1659: SIGTRAP crashes on macOS 15.5 with Apple Silicon (arm64) - similar Apple Silicon compatibility issues Feel free to ignore if none of these address your specific case.
Author
Owner

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

@manao29 can you run:

opencode run hello --print-logs

and show me output?

@rekram1-node commented on GitHub (Oct 3, 2025): @manao29 can you run: opencode run hello --print-logs and show me output?
Author
Owner

@manao29 commented on GitHub (Oct 3, 2025):

@manao29 can you run:

opencode run hello --print-logs

and show me output?

Thank you for your reply. I tried running the command you suggested, and here is the output I got:

Last login: Fri Oct 3 23:57:39 on ttys017
(base) hankang@hankangdeMac-mini ~ % opencode run hello --print-logs
INFO 2025-10-03T17:13:34 +49ms service=default version=0.14.1 args=["run","hello","--print-logs"] opencode
INFO 2025-10-03T17:13:34 +1ms service=project directory=/Users/hankang fromDirectory
INFO 2025-10-03T17:13:34 +6ms service=config path=/Users/hankang/.config/opencode/config.json loading
INFO 2025-10-03T17:13:34 +1ms service=config path=/Users/hankang/.config/opencode/opencode.json loading
INFO 2025-10-03T17:13:34 +0ms service=config path=/Users/hankang/.config/opencode/opencode.jsonc loading
INFO 2025-10-03T17:13:34 +1ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
INFO 2025-10-03T17:13:34 +7ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
INFO 2025-10-03T17:13:35 +30ms service=bus type=* subscribing
INFO 2025-10-03T17:13:35 +0ms service=bus type=session.updated subscribing
INFO 2025-10-03T17:13:35 +0ms service=bus type=message.updated subscribing
INFO 2025-10-03T17:13:35 +0ms service=bus type=message.part.updated subscribing
INFO 2025-10-03T17:13:35 +0ms service=format init
INFO 2025-10-03T17:13:35 +0ms service=bus type=file.edited subscribing
INFO 2025-10-03T17:13:35 +2ms service=session id=ses_654ef69cdffeK0G6YhhMWEbznr version=0.14.1 projectID=global directory=/Users/hankang title=New session - 2025-10-03T17:13:35.027Z time={"created":1759511615027,"updated":1759511615027} created
INFO 2025-10-03T17:13:35 +0ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, jdtls enabled LSP servers
INFO 2025-10-03T17:13:35 +3ms service=bus type=session.updated publishing
INFO 2025-10-03T17:13:35 +3ms service=bus type=message.part.updated subscribing
INFO 2025-10-03T17:13:35 +0ms service=bus type=session.error subscribing
INFO 2025-10-03T17:13:35 +0ms service=session.prompt session=ses_654ef69cdffeK0G6YhhMWEbznr prompt
INFO 2025-10-03T17:13:35 +1ms service=bus type=message.updated publishing
INFO 2025-10-03T17:13:35 +0ms service=bus type=message.part.updated publishing
INFO 2025-10-03T17:13:35 +1ms service=bus type=session.updated publishing
INFO 2025-10-03T17:13:35 +1ms service=models.dev file={} refreshing
INFO 2025-10-03T17:13:35 +2ms service=provider init
INFO 2025-10-03T17:13:35 +0ms service=provider providerID=openai found
INFO 2025-10-03T17:13:35 +0ms service=provider providerID=zhipuai found
INFO 2025-10-03T17:13:35 +0ms service=provider providerID=openrouter found
INFO 2025-10-03T17:13:35 +0ms service=provider providerID=opencode found
INFO 2025-10-03T17:13:35 +0ms service=provider providerID=openai modelID=gpt-5-codex getModel
INFO 2025-10-03T17:13:35 +1ms service=provider status=started providerID=openai getSDK
INFO 2025-10-03T17:13:35 +0ms service=bun pkg=@ai-sdk/openai version=latest installing package using Bun's default registry resolution
INFO 2025-10-03T17:13:35 +0ms service=bun cmd=["/Users/hankang/.opencode/bin/opencode","add","--force","--exact","--cwd","/Users/hankang/.cache/opencode","@ai-sdk/openai@latest"] cwd=/Users/hankang/.cache/opencode running
INFO 2025-10-03T17:13:37 +2886ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97)
stderr=Resolving dependencies
error: moving "@standard-schema/spec" to cache dir failed: EACCES: Permission denied (rename())
From: .dc6bce7e716675a8-00000001.spec
To: @standard-schema/spec@1.0.0@@@1
Resolved, downloaded and extracted [7]
error: InstallFailed extracting tarball from @standard-schema/spec
done
INFO 2025-10-03T17:13:37 +1ms service=provider status=completed duration=2887 providerID=openai getSDK
ERROR 2025-10-03T17:13:37 +2ms service=default providerID=openai name=ProviderInitError message=ProviderInitError cause=BunInstallFailedError: BunInstallFailedError stack=ProviderInitError: ProviderInitError
at new NamedError (unknown:1:28)
at new ProviderInitError (/$bunfs/root/index.js:61381:14)
at (/$bunfs/root/index.js:106138:35)
at processTicksAndRejections (native:7:39) fatal
Error: Unexpected error, check log file at for more details
(base) hankang@hankangdeMac-mini ~ %

@manao29 commented on GitHub (Oct 3, 2025): > [@manao29](https://github.com/manao29) can you run: > > opencode run hello --print-logs > > and show me output? Thank you for your reply. I tried running the command you suggested, and here is the output I got: Last login: Fri Oct 3 23:57:39 on ttys017 (base) hankang@hankangdeMac-mini ~ % opencode run hello --print-logs INFO 2025-10-03T17:13:34 +49ms service=default version=0.14.1 args=["run","hello","--print-logs"] opencode INFO 2025-10-03T17:13:34 +1ms service=project directory=/Users/hankang fromDirectory INFO 2025-10-03T17:13:34 +6ms service=config path=/Users/hankang/.config/opencode/config.json loading INFO 2025-10-03T17:13:34 +1ms service=config path=/Users/hankang/.config/opencode/opencode.json loading INFO 2025-10-03T17:13:34 +0ms service=config path=/Users/hankang/.config/opencode/opencode.jsonc loading INFO 2025-10-03T17:13:34 +1ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin INFO 2025-10-03T17:13:34 +7ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin INFO 2025-10-03T17:13:35 +30ms service=bus type=* subscribing INFO 2025-10-03T17:13:35 +0ms service=bus type=session.updated subscribing INFO 2025-10-03T17:13:35 +0ms service=bus type=message.updated subscribing INFO 2025-10-03T17:13:35 +0ms service=bus type=message.part.updated subscribing INFO 2025-10-03T17:13:35 +0ms service=format init INFO 2025-10-03T17:13:35 +0ms service=bus type=file.edited subscribing INFO 2025-10-03T17:13:35 +2ms service=session id=ses_654ef69cdffeK0G6YhhMWEbznr version=0.14.1 projectID=global directory=/Users/hankang title=New session - 2025-10-03T17:13:35.027Z time={"created":1759511615027,"updated":1759511615027} created INFO 2025-10-03T17:13:35 +0ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, jdtls enabled LSP servers INFO 2025-10-03T17:13:35 +3ms service=bus type=session.updated publishing INFO 2025-10-03T17:13:35 +3ms service=bus type=message.part.updated subscribing INFO 2025-10-03T17:13:35 +0ms service=bus type=session.error subscribing INFO 2025-10-03T17:13:35 +0ms service=session.prompt session=ses_654ef69cdffeK0G6YhhMWEbznr prompt INFO 2025-10-03T17:13:35 +1ms service=bus type=message.updated publishing INFO 2025-10-03T17:13:35 +0ms service=bus type=message.part.updated publishing INFO 2025-10-03T17:13:35 +1ms service=bus type=session.updated publishing INFO 2025-10-03T17:13:35 +1ms service=models.dev file={} refreshing INFO 2025-10-03T17:13:35 +2ms service=provider init INFO 2025-10-03T17:13:35 +0ms service=provider providerID=openai found INFO 2025-10-03T17:13:35 +0ms service=provider providerID=zhipuai found INFO 2025-10-03T17:13:35 +0ms service=provider providerID=openrouter found INFO 2025-10-03T17:13:35 +0ms service=provider providerID=opencode found INFO 2025-10-03T17:13:35 +0ms service=provider providerID=openai modelID=gpt-5-codex getModel INFO 2025-10-03T17:13:35 +1ms service=provider status=started providerID=openai getSDK INFO 2025-10-03T17:13:35 +0ms service=bun pkg=@ai-sdk/openai version=latest installing package using Bun's default registry resolution INFO 2025-10-03T17:13:35 +0ms service=bun cmd=["/Users/hankang/.opencode/bin/opencode","add","--force","--exact","--cwd","/Users/hankang/.cache/opencode","@ai-sdk/openai@latest"] cwd=/Users/hankang/.cache/opencode running INFO 2025-10-03T17:13:37 +2886ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97) stderr=Resolving dependencies error: moving "@standard-schema/spec" to cache dir failed: EACCES: Permission denied (rename()) From: .dc6bce7e716675a8-00000001.spec To: @standard-schema/spec@1.0.0@@@1 Resolved, downloaded and extracted [7] error: InstallFailed extracting tarball from @standard-schema/spec done INFO 2025-10-03T17:13:37 +1ms service=provider status=completed duration=2887 providerID=openai getSDK ERROR 2025-10-03T17:13:37 +2ms service=default providerID=openai name=ProviderInitError message=ProviderInitError cause=BunInstallFailedError: BunInstallFailedError stack=ProviderInitError: ProviderInitError at new NamedError (unknown:1:28) at new ProviderInitError (/$bunfs/root/index.js:61381:14) at <anonymous> (/$bunfs/root/index.js:106138:35) at processTicksAndRejections (native:7:39) fatal Error: Unexpected error, check log file at for more details (base) hankang@hankangdeMac-mini ~ %
Author
Owner

@webboty commented on GitHub (Oct 3, 2025):

i had this exact same issue. I figured that i had to add the provider and the model name to the model definition.

So i had to add sth. like:
lmstudio/gpt-os-120b or
lmstudio/qwen/qwen3-coder-30b-8bit

to make it work with my lmstudio setup.

That fixed it for me since then my local models are working like a charm (most of the time :-))

@manao29

@webboty commented on GitHub (Oct 3, 2025): i had this exact same issue. I figured that i had to add the provider and the model name to the model definition. So i had to add sth. like: lmstudio/gpt-os-120b or lmstudio/qwen/qwen3-coder-30b-8bit to make it work with my lmstudio setup. That fixed it for me since then my local models are working like a charm (most of the time :-)) @manao29
Author
Owner

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

@manao29 looks like some sort of permission issue given how you installed opencode, I assume you installed via npm here?

@rekram1-node commented on GitHub (Oct 3, 2025): @manao29 looks like some sort of permission issue given how you installed opencode, I assume you installed via npm here?
Author
Owner

@manao29 commented on GitHub (Oct 3, 2025):

@manao29 looks like some sort of permission issue given how you installed opencode, I assume you installed via npm here?

Thanks for your help! the earlier 400 Bad Request issue is now resolved. It is the permission issuse. It turned out to be caused by :

Permission problems in the ~/.bun and ~/.cache/opencode directories (some files were owned by root). I fixed this by cleaning those directories and resetting the ownership/permissions to my user.

After correcting these, the provider initialized successfully and the 400 error was gone.

Image
@manao29 commented on GitHub (Oct 3, 2025): > [@manao29](https://github.com/manao29) looks like some sort of permission issue given how you installed opencode, I assume you installed via npm here? Thanks for your help! the earlier 400 Bad Request issue is now resolved. It is the permission issuse. It turned out to be caused by : Permission problems in the ~/.bun and ~/.cache/opencode directories (some files were owned by root). I fixed this by cleaning those directories and resetting the ownership/permissions to my user. After correcting these, the provider initialized successfully and the 400 error was gone. <img width="1132" height="674" alt="Image" src="https://github.com/user-attachments/assets/4defc6be-72d8-4356-a560-fd92e9402a98" />
Author
Owner

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

sweet!

@rekram1-node commented on GitHub (Oct 3, 2025): sweet!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1938