Skip to content

[Simple] Tool Calls do not work if no newline is given at start #17253

@linsaftw

Description

@linsaftw

Description

Example:

Let me search for the fetch method properly:<tool_call>
<function=grep>
<parameter=-A>
10
</parameter>
<parameter=output>
content
</parameter>
<parameter=path>
/home/linsaftw/Downloads/scraper/scraper/fetcher/adaptive.py
</parameter>
<parameter=pattern>
async def fetch
</parameter>
</function>
</tool_call>

Solution A: Instruct the prompt to always add new lines before tool calls.
Solution B: Decode tool calls that do not have new lines before them.

Plugins

None

OpenCode version

1.2.24

Steps to reproduce

It happens randomly when using Step 3.5

Screenshot and/or share link

No response

Operating System

Kubuntu 25.10 (Docker w/debian)

Terminal

Konsole

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

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