Bug: Tool calls with Object arguments are serialized as string
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 152
- Avg merge
- 4h 14m
- Merged PRs (30d)
- 11
Description
When using FastFlowLM with OpenCode and Gemma 4 E4B model, I observed frequent tool call failures, by inspecting the log I observed the likely cause to be wrong data serialization
{
"content": "",
"role": "assistant",
"tool_calls": [
{
"function": {
"arguments": "{\"filePath\":\"./src/main/java/my/path/to/JavaClass.java\"}",
"name": "read"
},
"id": "call_1777830235_96",
"type": "function"
},
{
"function": {
"arguments": "{\"filePath\":\"./src/main/java/my/path/to/OtherClass.java\"}",
"name": "read"
},
"id": "call_1777830239_97",
"type": "function"
}
]
},
This results in error:
Invalid input for tool read: JSON parsing failed: Text: {{\\\"filePath\\\":\\\"./src/main/java/my/path/to/JavaClass.java\\\\"}}.
Error message: JSON Parse error: Expected '}'
Probably related to https://github.com/FastFlowLM/FastFlowLM/issues/483
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reviewing issue 483 and reproducing the failure with FastFlowLM, OpenCode, and the Gemma 4 E4B model, then trace tool-call argument serialization. Done means object arguments remain valid JSON for the tool parser and the reported read calls succeed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100