INFO 2025-06-25T09:09:30 +45ms service=default version=0.1.133 args=run,Explain,the,use,of,context,in,Go opencode
INFO 2025-06-25T09:09:30 +1ms service=app cwd=/Users/zheng-cheng/Documents/MiraclePlus/mp creating
INFO 2025-06-25T09:09:30 +6ms service=app git=/Users/zheng-cheng/Documents/MiraclePlus/mp git
INFO 2025-06-25T09:09:30 +2ms service=app name=share registering service
INFO 2025-06-25T09:09:30 +0ms service=bus type=storage.write subscribing
INFO 2025-06-25T09:09:30 +0ms service=app name=bus registering service
INFO 2025-06-25T09:09:30 +2ms service=session id=ses_859a6870affe2vKYl9mgW0nV1P version=0.1.133 title=New Session - 2025-06-25T09:09:30.998Z time=[object Object] created
INFO 2025-06-25T09:09:30 +0ms service=app name=session registering service
INFO 2025-06-25T09:09:30 +0ms service=app name=storage registering service
INFO 2025-06-25T09:09:30 +0ms service=storage path=/Users/zheng-cheng/.local/share/opencode/project/Users-zheng-cheng-Documents-MiraclePlus-mp/storage init
INFO 2025-06-25T09:09:30 +1ms service=bus type=storage.write publishing
INFO 2025-06-25T09:09:30 +0ms service=app name=config registering service
INFO 2025-06-25T09:09:31 +2ms service=config loaded
INFO 2025-06-25T09:09:31 +0ms service=bus type=session.updated publishing
INFO 2025-06-25T09:09:31 +0ms service=app name=provider registering service
INFO 2025-06-25T09:09:31 +2ms service=models.dev refreshing
INFO 2025-06-25T09:09:31 +1ms service=provider init
ERROR 2025-06-25T09:09:31 +14ms service=default fatal

Quick fix for people running into this issue and want to continue using
opencode: In the folder~/.local/share/opencode, deletepackage.jsonor the whole folderExample:
rm -rf ~/.local/share/opencode/package.jsonor~/.local/share/opencode–
@thdxr I’ve ran this locally and located the primary issue here:
I’m preparing a PR to update error handling for these cases.
Here’s a rough analysis of actual issue. I started checking out
packages/opencode/src/bun/index.ts(BunProc)'sinstallfunction, where it detects@aws-sdk/credential-providersalready within the package.json file, it thus skips installation the installation. But it’s not actually installed in the node_modules folder of the cache dir.After that, I tried always installing all packages (essentially removing the check if it’s listed in package.json), that causes issues with the BunProc’s
run, function because how we read stdout and stdin is broken.We can fix that by doing the following instead:
Once that is fixed, the following problem happened for me, somehow, also “amazon-bedrock” is listed for me as dependencies in the cache package.json file, but this package doesn’t exist, which causes the installation to occur:
Likely cause is in that there was some mistake in earlier versions that caused the state of the cache’s package.json to be broken, this also uncovered a couple of other bugs mentioned above.
We need strategy to how we deal with a broken package.json state / cache, e.g. automatically delete when broken state occurs, a clean command or something along those lines.
You can use
--print-logsto get more info when running opencode.Latest version is 0.1.135
I am using Warp 2.0 terminal
Thank you for reply! I don’t have
config.jsonoropencode.jsonfile