Skip to content

fix(opencode): improve local OpenAI-compatible backend robustness#20668

Open
krystophny wants to merge 1 commit intoanomalyco:devfrom
krystophny:fortbench/local-llamacpp-default-agent-fixes
Open

fix(opencode): improve local OpenAI-compatible backend robustness#20668
krystophny wants to merge 1 commit intoanomalyco:devfrom
krystophny:fortbench/local-llamacpp-default-agent-fixes

Conversation

@krystophny
Copy link
Copy Markdown

@krystophny krystophny commented Apr 2, 2026

Issue for this PR

Closes #20669

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This makes the default agent more tolerant of two local OpenAI-compatible backend quirks that showed up in real runs:

  • the bash tool can receive a valid command without a description
  • some backends return finish_reason: "tool_calls" with tool_calls: []

The change normalizes missing bash descriptions before validation/execution and treats empty tool_calls arrays as a normal stop instead of a real tool-call turn.

How did you verify your code works?

  • bun run --cwd packages/opencode typecheck
  • bun test test/tool/bash.test.ts test/provider/copilot/copilot-chat-model.test.ts
  • manual local smoke against a llama.cpp OpenAI-compatible backend with the default build agent

Screenshots / recordings

Not applicable. This is a backend/runtime bug fix.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Hey! Your PR title Improve local OpenAI-compatible backend robustness doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found several potentially related PRs:

Most Relevant:

  1. PR refactor(opencode): harden BashTool input validation and environment #19290 - refactor(opencode): harden BashTool input validation and environment

  2. PR fix(bash): make description parameter optional in bash tool #13832 - fix(bash): make description parameter optional in bash tool

  3. PR fix(bash): make description optional for tool calls #13288 - fix(bash): make description optional for tool calls

  4. PR fix(provider): handle empty content for bedrock/openai-compatible APIs #17396 - fix(provider): handle empty content for bedrock/openai-compatible APIs

  5. PR fix(opencode): filter empty text content blocks for all providers #17742 - fix(opencode): filter empty text content blocks for all providers

  6. PR feat: add streaming option to provider config to support non-streaming backends #15931 - feat: add streaming option to provider config to support non-streaming backends

These PRs may have already addressed parts of what PR #20668 is fixing. Consider reviewing them to ensure no duplicate effort.

@krystophny krystophny changed the title Improve local OpenAI-compatible backend robustness fix(opencode): improve local OpenAI-compatible backend robustness Apr 2, 2026
@github-actions github-actions bot removed needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@krystophny krystophny force-pushed the fortbench/local-llamacpp-default-agent-fixes branch from a4d3f0f to 0ae84cc Compare April 2, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant