Skip to content

Opencode halts on "Generating.." when context reaches around 35% for qwen3-coder-480b #3189

Closed

Description

@FarrukhCyber

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?

Activity

  1. github-actions commented on Oct 15, 2025

    @github-actions
    Contributor

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

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

  2. rekram1-node commented on Oct 15, 2025

    @rekram1-node
    Contributor

    it always hangs on generating at 30% every time? No errors or anything?

  3. FarrukhCyber commented on Oct 15, 2025

    @FarrukhCyber
    Author

    yes no errors. I'm trying to automate opencode in a script so this issue is really annoying considering I cant call /compact

  4. rekram1-node commented on Oct 15, 2025

    @rekram1-node
    Contributor

    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:

    opencode run hello --print-logs -c
    

    -c will make it last updated session

  5. FarrukhCyber commented on Oct 20, 2025

    @FarrukhCyber
    Author

    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

  6. rekram1-node commented on Oct 21, 2025

    @rekram1-node
    Contributor

    Is it any better with:

    {
      "$schema": "https://opencode.ai/config.json",
      "lsp": {
        "rust": {
          "disabled": true
        },
        "clangd": {
          "disabled": true
        }
      }
    }
    

    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

  7. FarrukhCyber commented on Oct 22, 2025

    @FarrukhCyber
    Author

    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
    
    
  8. rekram1-node commented on Oct 22, 2025

    @rekram1-node
    Contributor

    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

  9. FarrukhCyber commented on Nov 3, 2025

    @FarrukhCyber
    Author

    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

    • I have access to model in the my us-west-2 region
    • model config in opencode.config is correct:
       "deepseek.v3-v1:0": {
        "name": "DeepSeek-v3.1",
        "limit": {
          "context": 163840,
          "output": 81920
        },
        "cost": {
          "cache_read": 0,
          "cache_write": 0,
          "input": 0.58,
          "output": 1.68
        }
      }
    
    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
    
  10. rekram1-node commented on Nov 3, 2025

    @rekram1-node
    Contributor

    @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?

  11. FarrukhCyber commented on Nov 3, 2025

    @FarrukhCyber
    Author

    Even after removing it, I'm getting the same error:

    $ opencode models | grep deepseek
    amazon-bedrock/deepseek.v3-v1:0
    amazon-bedrock/deepseek.r1-v1:0
    
    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.
    
  12. rekram1-node commented on Nov 3, 2025

    @rekram1-node
    Contributor
  13. FarrukhCyber commented on Nov 3, 2025

    @FarrukhCyber
    Author

    yes. In the same region, Qwen3 coder 480b is working.

    $ echo $AWS_REGION
    us-west-2
    
  14. FarrukhCyber commented on Nov 3, 2025

    @FarrukhCyber
    Author

    I'm also getting this error when opencode updated to latest version (1.0). It works, but the error message stays on chat box

    Image
  15. rekram1-node commented on Nov 3, 2025

    @rekram1-node
    Contributor

    @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 config it will show u where your plugin is defined

  16. FarrukhCyber commented on Nov 3, 2025

    @FarrukhCyber
    Author

    oh okay, Thanks!!

  17. FarrukhCyber commented on Nov 3, 2025

    @FarrukhCyber
    Author

    I'm also getting this error when opencode updated to latest version (1.0). It works, but the error message stays on chat box

    Image

    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?

  18. rekram1-node commented on Nov 3, 2025

    @rekram1-node
    Contributor

    @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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions