Skip to content

fix(opencode): make bash tool description parameter optional#26419

Open
RheagalFire wants to merge 2 commits intoanomalyco:devfrom
RheagalFire:fix/bash-description-optional
Open

fix(opencode): make bash tool description parameter optional#26419
RheagalFire wants to merge 2 commits intoanomalyco:devfrom
RheagalFire:fix/bash-description-optional

Conversation

@RheagalFire
Copy link
Copy Markdown

Issue for this PR

Closes #20669

Type of change

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

What does this PR do?

The bash tool's description parameter is defined as Schema.String (required) in prompt.ts. Local OpenAI-compatible backends like llama.cpp, LM Studio, and LiteLLM sometimes omit this field when calling the
tool. This causes validation to fail with expected string, received undefined, killing the agent loop.

The fix:

  • prompt.ts: Changed Schema.String to Schema.optional(Schema.String) for the description parameter
  • shell.ts: Added ?? "" fallback where params.description is passed downstream, since the type is now string | undefined

The prompt text already says "it is very helpful if you write a clear, concise description" which implies optional behavior. This aligns the schema with that intent.

How did you verify your code works?

  • bun turbo typecheck passes (12/12 packages)
  • Husky pre-push hook passes

Checklist

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Hey! Your PR title Fix/bash description optional 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 May 8, 2026

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

Potential Duplicate Found:

Related PR:

@RheagalFire RheagalFire force-pushed the fix/bash-description-optional branch from 8769f7b to d7b5878 Compare May 8, 2026 23:09
@RheagalFire RheagalFire changed the title Fix/bash description optional fix(opencode): make bash tool description parameter optional May 8, 2026
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