Skip to content

Default agent is brittle against local OpenAI-compatible tool-call quirks #20669

Closed as not planned

Description

@krystophny

Summary

When the default OpenCode agent talks to local OpenAI-compatible backends, two brittle cases can break or stall normal tool use:

  • the bash tool can fail hard if the model omits description but provides a valid command
  • some local backends return finish_reason: "tool_calls" together with tool_calls: [], which should not be treated as a real tool-call turn

Reproduction

Use the default build agent against a local OpenAI-compatible backend such as llama.cpp or LM Studio.

Observed failures:

  • The bash tool was called with invalid arguments ... expected string, received undefined on description
  • session loop/hang behavior when empty tool_calls: [] is returned

Expected

  • harmless missing bash descriptions should be normalized or defaulted
  • empty tool_calls arrays should be treated like a normal stop completion

Verification

This was reproduced against a local llama.cpp backend with the default agent/tool stack.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 2, 2026
  2. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

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

    The first part of this issue (bash tool failing on missing description) may be distinct, but please review those issues to see if your second symptom is already tracked.

  3. ByteBand1t commented on Apr 2, 2026

    @ByteBand1t

    This also fixes #20719 — our Paperclip + LiteLLM + Ollama setup where agents stop after first LLM call. Please prioritize merging

  4. daniel-farina commented on Apr 3, 2026

    @daniel-farina

    I tested this and helped get gemma working with open code
    https://gist.github.com/daniel-farina/87dc1c394b94e45bb700d27e9ea03193

  5. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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