Skip to content

Bug Report: invalid internal tool is exposed and can spam repeated calls #21900

@Jonathan523

Description

@Jonathan523

Description

Summary

OpenCode Desktop exposes an internal fallback tool named invalid in user-facing error output. In some sessions, one malformed tool call can cascade into many repeated invalid call entries, which floods the UI and makes debugging difficult.

Environment

  • OpenCode Desktop: 1.4.3
  • Platform: Windows
  • Install source: Scoop

Actual behavior

  • Error messages may show:
Model tried to call unavailable tool ''. Available tools: invalid, question, bash, read, ...
  • The UI may then show many repeated invalid tool-call entries.
Image

Expected behavior

  • invalid should remain internal and never appear in user-facing available tool lists.
  • A malformed tool call should fail once, or be circuit-broken quickly, instead of repeating dozens of times.

Investigation

This does not appear to come from user config. Local config files did not define any invalid tool.

Evidence from the desktop runtime shows:

  • An internal tool is explicitly defined:
...\opencode-cli.exe: InvalidTool = Tool2.define("invalid", ...)
  • Normal active tools already exclude it:
activeTools: Object.keys(tools).filter((x) => x !== "invalid")
  • But unavailable-tool error messages still print an available tools list that includes invalid:
Model tried to call unavailable tool '${toolName}'. Available tools: ${availableTools.join(", ")}

Likely issue

The runtime seems to filter invalid out of normal active tools, but not out of the error/reporting path. That leaks an internal tool into user-facing output. When the model emits malformed tool calls, the fallback path may repeatedly rewrite them into invalid, causing UI spam.

Requested fix

  1. Filter invalid out of all user-facing available-tool lists, including error messages.
  2. Treat invalid as strictly internal and do not surface it as a normal tool.
  3. Add a circuit breaker so repeated malformed tool calls do not produce dozens of invalid entries.

Preferred result after fix

Instead of:

Model tried to call unavailable tool ''. Available tools: invalid, question, bash, read, ...

It should be:

Model tried to call unavailable tool ''. Available tools: question, bash, read, ...

And the session should show at most one or very few failure entries, not a long invalid spam sequence.

Plugins

oh-my-openagent

OpenCode version

1.4.3

Steps to reproduce

  1. Launch OpenCode Desktop 1.4.3
  2. Start a session with normal tool access enabled
  3. Ask the model to perform a relatively complex tool workflow, especially:
  4. multiple tool calls in one response
  5. parallel tool usage
  6. complex argument structures
  7. Once the model emits a malformed tool call (common symptom: empty tool name '', or invalid tool name / argument shape)
  8. Watch the UI / tool call log

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

OpenCode Desktop

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)webRelates to opencode on web / desktopwindows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions