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
Opencode halts on "Generating.." when context reaches around 35% for qwen3-coder-480b #3189
It happens when using qwen3-coder-480b through aws bedrock, so I have to run /compact command and re-query it. What could be the possible reasons for it?
Apologies for the delay.
Here's the log file of the session that is stuck on "Generating..." right now on 37% context usage. It works if I run /compact and provide another query so, doesn't look like the issue is on the aws bedrock side.
Sometimes lsps cause issues idk what that'd have to do with 35% context, could be we are silently retrying an error which we will fi shortly but i saw c files and rust lsp so figured this may make sense to try
Thank you for the suggestion but it didn't workout. I updated opencode and now after a while it results in an error. Also in the opencode.config, I have set the following limit values:
limit": {
"context": 262144,
"output": 66536
}
However in the logs I see this: inferenceConfig":{"maxTokens":32000,"topP":1}
end lines from logs:
Clearly tell the agent whether you expect it to write code or just to do
research (search, file reads, web fetches, etc.), since it is not aware of the
user's intent\n6. If the agent description mentions that it should be used
proactively, then you should try your best to use it without the user having to
ask for it first. Use your judgement.\n\nExample usage (NOTE: The agents below
are fictional examples for illustration only - use the actual agents listed
above):\n\n<example_agent_descriptions>\n\"code-reviewer\": use this agent after
you are done writing a signficant piece of code\n\"greeting-responder\": use
this agent when to respond to user greetings with a friendly
joke\n</example_agent_description>\n\n<example>\nuser: \"Please write a function
that checks if a number is prime\"\nassistant: Sure let me write a function that
checks if a number is prime\nassistant: First let me use the Write tool to write
a function that checks if a number is prime\nassistant: I'm going to use the
Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n
<= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0)
return false\n }\n return true\n}\n</code>\n<commentary>\nSince a signficant
piece of code was written and the task was completed, now use the code-reviewer
agent to review the code\n</commentary>\nassistant: Now let me use the
code-reviewer agent to review the code\nassistant: Uses the Task tool to launch
the code-reviewer agent\n</example>\n\n<example>\nuser:
\"Hello\"\n<commentary>\nSince the user is greeting, use the greeting-responder
agent to respond with a friendly joke\n</commentary>\nassistant: \"I'm going to
use the Task tool to launch the with the greeting-responder
agent\"\n</example>\n",
"inputSchema":{"json":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"description":"A
short (3-5 words) description of the
task","type":"string"},"prompt":{"description":"The task for the agent to
perform","type":"string"},"subagent_type":{"description":"The type of
specialized agent to use for this
task","type":"string"}},"required":["description","prompt","subagent_type"],"additionalProperties":false}}}}],"toolChoice":{"auto":{}}}},"statusCode":500,"responseHeaders":{"connection":"keep-alive","content-length":"99","content-type":"application/json","date":"Wed,
22 Oct 2025 20:07:21
GMT","x-amzn-errortype":"InternalServerException:http://internal.amazon.com/coral/com.amazon.bedrock/","x-amzn-requestid":"f58cc522-b82f-4c9e-b884-5485e35988de"},"responseBody":"{\"message\":\"The
system encountered an unexpected error during processing. Try your request
again.\"}","isRetryable":true,"data":{"message":"The system encountered an
unexpected error during processing. Try your request again."}}}} stream error
INFO 2025-10-22T20:07:21 +7ms service=session.prompt
session=ses_5fc24b6e5ffebI25nhJ5zxFHlD type=error part ERROR 2025-10-22T20:07:21
+1ms service=session.prompt session=ses_5fc24b6e5ffebI25nhJ5zxFHlD error=Failed
after 11 attempts. Last error: undefined: The system encountered an unexpected
error during processing. Try your request again. process"}}}} stream error
INFO 2025-10-22T20:07:21 +7ms service=session.prompt session=ses_5fc24b6e5ffebI25nhJ5zxFHlD type=error part
ERROR 2025-10-22T20:07:21 +1ms service=session.prompt session=ses_5fc24b6e5ffebI25nhJ5zxFHlD error=Failed after 11 attempts. Last error: undefined: The system encountered an unexpected error during processing. Try your request again. process
INFO 2025-10-22T20:07:21 +0ms service=bus type=session.error publishing
INFO 2025-10-22T20:07:21 +1ms service=bus type=message.updated publishing
INFO 2025-10-22T20:07:21 +1ms service=bus type=message.updated publishing
INFO 2025-10-22T20:07:21 +0ms service=session.compaction pruning
INFO 2025-10-22T20:07:21 +1ms service=session.lock sessionID=ses_5fc24b6e5ffebI25nhJ5zxFHlD unlocked
INFO 2025-10-22T20:07:21 +0ms service=session.prompt session=ses_5fc24b6e5ffebI25nhJ5zxFHlD sessionID=ses_5fc24b6e5ffebI25nhJ5zxFHlD unlocking
INFO 2025-10-22T20:07:21 +0ms service=server duration=2057249 response
INFO 2025-10-22T20:07:21 +0ms service=bus type=session.idle publishing
ERROR 2025-10-22T20:07:21 +0ms service=tui message=AI_RetryError: Failed after 11 attempts. Last error: undefined: The system encountered an unexpected error during processing. Try your request again. name=UnknownError Server error
INFO 2025-10-22T20:07:21 +27ms service=session.compaction pruned=0 total=0 found
INFO 2025-10-22T20:13:56 +395182ms service=models.dev file={} refreshing
INFO 2025-10-22T20:20:16 +379634ms service=tui offset=13176 x=82 y=42 mouse
INFO 2025-10-22T20:20:16 +1ms service=tui end=-1,-1 start=82,13218 mouse selection
That max output tokens 32k is telling the llm not to output more than 32k at once, it isn't saying that is the max context window size or anything it is mostly there to control verbosity
Hi @rekram1-node,
I 'm trying to use the deepseek.v3-v1:0 model from bedrock but I'm getting the following error. IN the initial logs, it shows that model is found but later error occurs. I have checked that
INFO 2025-11-03T18:00:46 +26ms service=provider providerID=opencode found
INFO 2025-11-03T18:00:46 +0ms service=provider providerID=amazon-bedrock found
INFO 2025-11-03T18:00:46 +0ms service=provider providerID=amazon-bedrock modelID=deepseek.v3-v1:0 getModel
INFO 2025-11-03T18:00:46 +1ms service=provider status=started providerID=amazon-bedrock getSDK
INFO 2025-11-03T18:00:46 +39ms service=provider status=completed duration=39 providerID=amazon-bedrock getSDK
INFO 2025-11-03T18:00:46 +0ms service=provider providerID=amazon-bedrock modelID=deepseek.v3-v1:0 found
...
...
INFO 2025-11-03T18:00:47 +2ms service=session.prompt session=ses_5b524d849ffemvcXN2XoQt8Bm3 type=error part
ERROR 2025-11-03T18:00:47 +1ms service=session.prompt session=ses_5b524d849ffemvcXN2XoQt8Bm3 error=undefined: The provided model identifier is invalid. process
INFO 2025-11-03T20:21:59 +26ms service=provider providerID=opencode found
INFO 2025-11-03T20:21:59 +0ms service=provider providerID=amazon-bedrock found
INFO 2025-11-03T20:21:59 +0ms service=provider providerID=amazon-bedrock modelID=deepseek.v3-v1:0 getModel
INFO 2025-11-03T20:21:59 +0ms service=provider status=started providerID=amazon-bedrock getSDK
INFO 2025-11-03T20:21:59 +40ms service=provider status=completed duration=40 providerID=amazon-bedrock getSDK
INFO 2025-11-03T20:21:59 +0ms service=provider providerID=amazon-bedrock modelID=deepseek.v3-v1:0 found
INFO 2025-11-03T20:21:59 +0ms service=session.lock sessionID=ses_5b49dc75dffes40fomY2AyFety locked
INFO 2025-11-03T20:21:59 +0ms service=session.prompt session=ses_5b49dc75dffes40fomY2AyFety sessionID=ses_5b49dc75dffes40fomY2AyFety locking
INFO 2025-11-03T20:21:59 +20ms service=bus type=message.updated publishing
INFO 2025-11-03T20:21:59 +4ms service=session.prompt session=ses_5b49dc75dffes40fomY2AyFety process
INFO 2025-11-03T20:21:59 +1ms service=provider providerID=amazon-bedrock modelID=anthropic.claude-haiku-4-5-20251001-v1:0 getModel
INFO 2025-11-03T20:21:59 +0ms service=provider status=started providerID=amazon-bedrock getSDK
INFO 2025-11-03T20:21:59 +0ms service=provider status=completed duration=0 providerID=amazon-bedrock getSDK
INFO 2025-11-03T20:21:59 +1ms service=session.prompt session=ses_5b49dc75dffes40fomY2AyFety type=start part
INFO 2025-11-03T20:21:59 +0ms service=provider providerID=amazon-bedrock modelID=anthropic.claude-haiku-4-5-20251001-v1:0 found
....
....
INFO 2025-11-03T20:22:00 +2ms service=session.prompt session=ses_5b49dc75dffes40fomY2AyFety type=error part
ERROR 2025-11-03T20:22:00 +1ms service=session.prompt session=ses_5b49dc75dffes40fomY2AyFety error=undefined: The provided model identifier is invalid. process
INFO 2025-11-03T20:22:00 +0ms service=bus type=session.error publishing
Error: undefined: The provided model identifier is invalid.
I'm also getting this error when opencode updated to latest version (1.0). It works, but the error message stays on chat box
Adding onto this, on the amazon bedrock qwen coder 480b model card page, the context is 131072 but opencode shows 12,273 tokens only. Is it something to do with default quota values?
Activity
github-actions commentedon Oct 15, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 15, 2025
it always hangs on generating at 30% every time? No errors or anything?
FarrukhCyber commentedon Oct 15, 2025
yes no errors. I'm trying to automate opencode in a script so this issue is really annoying considering I cant call
/compactrekram1-node commentedon Oct 15, 2025
hmm no errors is pretty weird, if you have a session that is hanging can you grab the log for it?
~/.local/share/opencode/log/...
^ should be latest
alternatively if the hanging session is the last one you sent a prompt to (or you can send a new one now to make it so)
then try:
-c will make it last updated session
FarrukhCyber commentedon Oct 20, 2025
Apologies for the delay.
Here's the log file of the session that is stuck on "Generating..." right now on 37% context usage. It works if I run /compact and provide another query so, doesn't look like the issue is on the aws bedrock side.
shared.log
rekram1-node commentedon Oct 21, 2025
Is it any better with:
Sometimes lsps cause issues idk what that'd have to do with 35% context, could be we are silently retrying an error which we will fi shortly but i saw c files and rust lsp so figured this may make sense to try
FarrukhCyber commentedon Oct 22, 2025
Thank you for the suggestion but it didn't workout. I updated opencode and now after a while it results in an error. Also in the opencode.config, I have set the following limit values:
However in the logs I see this:
inferenceConfig":{"maxTokens":32000,"topP":1}end lines from logs:
rekram1-node commentedon Oct 22, 2025
That max output tokens 32k is telling the llm not to output more than 32k at once, it isn't saying that is the max context window size or anything it is mostly there to control verbosity
FarrukhCyber commentedon Nov 3, 2025
Hi @rekram1-node,
I 'm trying to use the deepseek.v3-v1:0 model from bedrock but I'm getting the following error. IN the initial logs, it shows that model is found but later error occurs. I have checked that
opencode.configis correct:rekram1-node commentedon Nov 3, 2025
@FarrukhCyber hm why do u need to define the model in your opencode.json? Isn't it already defined?
Can u comment that out and run
opencode models?FarrukhCyber commentedon Nov 3, 2025
Even after removing it, I'm getting the same error:
rekram1-node commentedon Nov 3, 2025
@FarrukhCyber there may be a bug here: https://github.com/sst/opencode/blob/7652a9606413f0d6e9af2c65aeee692c44996006/packages/opencode/src/provider/provider.ts#L80-L116
Do u have
AWS_REGIONregion set correctly?FarrukhCyber commentedon Nov 3, 2025
yes. In the same region, Qwen3 coder 480b is working.
FarrukhCyber commentedon Nov 3, 2025
I'm also getting this error when opencode updated to latest version (1.0). It works, but the error message stays on chat box
rekram1-node commentedon Nov 3, 2025
@FarrukhCyber that issue is due to a plugin, you wrote a custom plugin and it is failing for some reason
if u do
opencode debug configit will show u where your plugin is definedFarrukhCyber commentedon Nov 3, 2025
oh okay, Thanks!!
FarrukhCyber commentedon Nov 3, 2025
Adding onto this, on the amazon bedrock qwen coder 480b model card page, the context is 131072 but opencode shows 12,273 tokens only. Is it something to do with default quota values?
rekram1-node commentedon Nov 3, 2025
@FarrukhCyber that context it is showing is the amount of context it has "populated" / used, it doesn't mean the context limit of the model.
I think we may change to a more clear context indicator soon