Skip to content

fix: make bash tool description parameter optional#18392

Open
danielcherubini wants to merge 3 commits intoanomalyco:devfrom
danielcherubini:dev
Open

fix: make bash tool description parameter optional#18392
danielcherubini wants to merge 3 commits intoanomalyco:devfrom
danielcherubini:dev

Conversation

@danielcherubini
Copy link

@danielcherubini danielcherubini commented Mar 20, 2026

Issue for this PR

Closes #13146

Also:

Related (local/small model tool schema issues):

Type of change

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

What does this PR do?

The description parameter on the bash tool is required but some models (especially smaller/local models) don't always include it in tool calls, causing "Invalid input: expected string, received undefined" errors that loop indefinitely. Make it optional and fall back to the command string when not provided.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

I ran opencode in two different repos, using small and larger models and found no issue with the error I have seen in issue #13146

Screenshots / recordings

image image

Checklist

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

If you do not follow this template your PR will be automatically rejected.

The description parameter on the bash tool is required but some models
(especially smaller/local models) don't always include it in tool calls,
causing "Invalid input: expected string, received undefined" errors that
loop indefinitely. Make it optional and fall back to the command string
when not provided.

Fixes anomalyco#13146
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

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

Potential Duplicate PRs Found:

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

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

These PRs appear to address the exact same issue as PR #18392 - making the bash tool's description parameter optional to handle cases where smaller/local models don't include it in tool calls. You should check the status of these existing PRs before proceeding with PR #18392.

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.

Bash(ls -la) tool description parameter is required but not exposed in tool schema — breaks all bash calls

1 participant