Skip to content

Opencode with litellm just stops before finishing the task. #3365

Closed

Description

@sylvain-billie

Question

On a mac, with opencode version: 0.15.13.

{
  "$schema": "https://opencode.ai/config.json",
  "model": "litellm/gemini-2.5-pro",
  "small_model": "litellm/gemini-2.5-flash",
  "provider": {
    "litellm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "<name>",
      "options": {
        "baseURL": "<url>",
        "timeout": 600000
      },
      "models": {
        "gemini-2.5-pro": {
          "name": "gemini-2.5-pro",
          "options": {
            "temperature": 0.7,
            "top_p": 1,
            "max_tokens": 2048,
            "stop": [],
            "response_format": {
              "type": "text"
            },
            "tool_choice": "auto",
            "thinking": {
              "type": "enabled",
              "budget_tokens": 4096
            }
          }
        },
        "gemini-2.5-flash-lite": {
          "name": "gemini-2.5-flash-lite"
        },
        "gemini-2.5-flash": {
          "name": "gemini/gemini-2.5-flash"
        }
      }
    }
  },
  "tools": {
    "bash": true,
    "read": true,
    "grep": true,
    "glob": true,
    "list": true,
    "patch": true,
    "todowrite": true
  }
}

I tried without the "options" as well.

What happens is, the agent just gives up in the middle of a task.
If I have subagents, they get started, but they stop, and the primary agent just waits forever.

Anyone knows if I am missing a config or if there is a way to see logs so I can know what's up?

you can see it give up in this gif:

Image

Activity

  1. github-actions commented on Oct 22, 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 22, 2025

    @rekram1-node
    Contributor

    @sylvain-billie as far as I can tell and I watched your whole recording, this is just the model stopping, it isn't opencodes fault (nor is your config bad) it is just the model stopping, it looped a decent amount but there are more capable models than gemini 2.5 pro, even the "dumber" models like kimi k2 are much more capable agentically (can loop longer)

    But then again, even good models like gpt-5-codex will do this "stop" occasionally.

  3. self-assigned this
    on Oct 22, 2025
  4. sylvain-billie commented on Oct 23, 2025

    @sylvain-billie
    Author

    @rekram1-node I see, thanks for checking.

    But then how can you handle sub-agents? Since they stop, I can't ask them to continue. Any request to them goes back to the primary. And the primary says it's waiting for the sub to finish.

  5. rekram1-node commented on Oct 23, 2025

    @rekram1-node
    Contributor

    we need a better ux for subagents but it is hard to tell what could br causing that for you, the primary agent is aware of whatever the last thing a subagent says

  6. sylvain-billie commented on Oct 23, 2025

    @sylvain-billie
    Author

    alright, thanks for taking the time. I'll close this issue.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions