You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Infinite installation loop of @aws-sdk/credential-providers on startup when AWS_BEARER_TOKEN_BEDROCK is set #6765
OpenCode hangs on startup when the AWS_BEARER_TOKEN_BEDROCK environment variable is set. It triggers a re-installation of @aws-sdk/credential-providers on every single launch, even if the package is already successfully installed.
This becomes a blocking issue if the connection to the npm registry is slow or unstable (e.g., when using a custom registry mirror like npmmirror), causing the CLI to hang indefinitely during the network request.
Verification:
I confirmed that manually modifying ~/.cache/opencode/package.json by changing the version of @aws-sdk/credential-providers from the specific version number (e.g., "3.962.0") to "latest" makes the issue disappear immediately.
Root Cause Analysis:
I investigated the source code and identified the issue in packages/opencode/src/bun/index.ts.
src/provider/provider.ts calls BunProc.install("@aws-sdk/credential-providers") without a version, defaulting to "latest".
BunProc.install compares the installed version in package.json (e.g., "3.962.0") against the requested version ("latest").
Since "3.962.0" !== "latest", it forces a bun add command every time, triggering unnecessary network requests.
Plugins
Default
OpenCode version
1.0.220
Steps to reproduce
Export AWS_BEARER_TOKEN_BEDROCK=test_token in your shell.
Run opencode.
The CLI hangs during initialization.
Running opencode --print-logs shows it is stuck at: INFO service=bun ... installing package using Bun's default registry resolution pkg=@aws-sdk/credential-providers version=latest
This issue might be a duplicate of existing issues. Please check:
opencode get stuck when bun add get stuck #4682: opencode get stuck when bun add get stuck - Reports similar hanging issues during package installation, though the root cause may be related to your identified version comparison problem.
Feel free to ignore if your specific case differs from those issues.
Activity
github-actions commentedon Jan 3, 2026
This issue might be a duplicate of existing issues. Please check:
bun addget stuck #4682: opencode get stuck whenbun addget stuck - Reports similar hanging issues during package installation, though the root cause may be related to your identified version comparison problem.Feel free to ignore if your specific case differs from those issues.
chindris-mihai-alexandru commentedon Jan 27, 2026
I experienced the same BunInstallFailedError with @aws-sdk/credential-providers on OpenCode v1.1.36 running on macOS.
Environment: AWS environment variables set (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
Workaround that worked:
After this, OpenCode starts normally without the installation loop. Can confirm the npm workaround is effective for this version.
github-actions commentedon Mar 30, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.