Skip to content

[FEATURE]: Auto-trim tool names in experimental_repairToolCall #24924

Closed as duplicate

Description

@KrabsWong

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem:

Some models (e.g., kimi-k2.5) occasionally generate tool calls with leading/trailing whitespace in the tool name (e.g., ' bash' instead of 'bash'). This causes the SDK to throw "Model tried to call unavailable tool ' bash'" errors, even though the tool exists.

Current Behavior:

The experimental_repairToolCall callback only handles case mismatches (e.g., 'Bash' → 'bash'), but not whitespace issues.

Proposed Solution:

Automatically trim whitespace from tool names before validation, or provide a built-in repair mechanism similar to case-insensitive matching.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Apr 29, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 29, 2026
  3. github-actions commented on Apr 29, 2026

    @github-actions
    Contributor

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

    If your feature request adds something beyond what's already tracked in #4279, please clarify the distinction there or here so maintainers can decide whether to merge or keep them separate.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions