Repository navigation
[BUG]: Bedrock provider hangs indefinitely on all model calls in v1.16.0 #30858
Description
Bug Report: opencode 1.16.0 — Bedrock Provider Hangs on All Model Calls
Summary
opencode v1.16.0's Amazon Bedrock provider hangs indefinitely on all model invocations, while the same AWS credentials and model IDs work correctly via the AWS CLI (aws bedrock-runtime converse).
Environment
- opencode version: 1.16.0 (installed via Homebrew)
- OS: macOS Darwin 25.5.0 arm64
- AWS CLI: v2 (working)
- Auth method: AWS SSO (
aws sso login --profile bedrock) - Region: us-east-1
- Profile: bedrock
Steps to Reproduce
1. Configure provider
{
"provider": {
"amazon-bedrock": {
"options": {
"region": "us-east-1",
"profile": "bedrock"
}
}
}
}2. Verify AWS CLI works
aws bedrock-runtime converse \
--model-id us.anthropic.claude-opus-4-6-v1 \
--profile bedrock --region us-east-1 \
--messages '[{"role":"user","content":[{"text":"test"}]}]'
# ✅ Returns response immediately3. Run opencode — hangs
opencode run --model amazon-bedrock/anthropic.claude-opus-4-6-v1 "test"
# ❌ Hangs indefinitely, no output, no errorAffected Models
All Bedrock models tested hang:
anthropic.claude-opus-4-6-v1(requires inference profile)us.anthropic.claude-opus-4-6-v1(inference profile)global.anthropic.claude-opus-4-6-v1(inference profile)anthropic.claude-opus-4-5-20251101-v1:0(on-demand)anthropic.claude-sonnet-4-5-20250929-v1:0(on-demand)anthropic.claude-haiku-4-5-20251001-v1:0(on-demand)
Debug Output
With --log-level DEBUG --print-logs, the last log line before hang is:
service=provider status=completed duration=0 providerID=amazon-bedrock getSDK
service=llm providerID=amazon-bedrock modelID=anthropic.claude-haiku-4-5-20251001-v1:0 ... stream
The SDK initializes successfully, but the LLM stream never produces output or errors.
Key Observations
- AWS side is not the problem:
aws bedrock-runtime converseworks with the same credentials, model IDs, and regions. - Inference profile vs on-demand:
opus-4-6requires inference profile (not on-demand), but the hang occurs even with on-demand models likehaiku-4-5. - No timeout: opencode hangs indefinitely without error or timeout.
- Other providers work: MiMo (when key valid) responds, confirming the issue is Bedrock-specific.
Expected Behavior
opencode should either:
- Successfully stream the response
- Or error with a meaningful message (e.g., "requires inference profile", "timeout", "auth error")
Actual Behavior
Complete hang — no output, no error, no timeout. Process must be manually killed.
Workaround
Use AWS CLI directly as a temporary replacement:
aws bedrock-runtime converse \
--profile bedrock \
--region us-east-1 \
--model-id us.anthropic.claude-opus-4-6-v1 \
--messages '[{"role":"user","content":[{"text":"your prompt"}]}]'Or use the wrapper script at ~/.config/opencode/opencode-bedrock-workaround.sh.
Severity
High — Completely blocks Bedrock usage in opencode. No workaround within the tool itself.
Possible Cause
Likely a regression in the @ai-sdk/amazon-bedrock provider integration in v1.16.0. The SDK initializes but the streaming implementation may be stuck in an async loop, waiting for an event that never fires, or failing to handle the Bedrock Converse API response format correctly.
Additional Context
- The AWS SSO token is valid (verified via
aws sts get-caller-identity). - The same issue occurs with
--pureflag (no external plugins). - The issue occurs in both
runand interactive TUI modes.
Activity
insign commentedon Jun 5, 2026
my opencode sqlite corrupted now any subagent call returns errors like:
SQLiteError: NOT NULL constraint failed: session_message.seq at run (unknown) at #run (bun:sqlite: 185:20) at
appendMessage (/$bunfs/root/chunk-zzy7ekmn.js:2 :...
insign commentedon Jun 5, 2026
Not sure if is the same problem but delete ~/.local/share/opencode/opencode.db solved even losing the old sessions.
alblez commentedon Jun 5, 2026
I just sent a PR but also lost all the sessions 🥲
tyeetale commentedon Jun 7, 2026
I also am seeing the same thing.
rekram1-node commentedon Jun 7, 2026
@tyeetale update to latest?