Repository navigation
Tool execution aborted when tool call is truncated (empty input) #13102
Description
Activity
github-actions commented on Feb 11, 2026
This issue might be related to existing issues addressing similar tool execution failures:
- Infinite retry loop when StreamIdleTimeoutError occurs during tool input generation #12234: Infinite retry loop when StreamIdleTimeoutError occurs during tool input generation — directly addresses stream truncation causing tool input failures
- Invalild tool + execution aborted #11612: Invalid tool + execution aborted — discusses tool execution abortion with validation errors
Your report provides additional detail about the truncation → empty input → abort mechanism. The maintainers may consolidate findings across these issues.
same here
I'm also running into this issue with a local model served via vLLM . I'd like to propose a practical approach for handling this case.
When the model is streaming a tool call (e.g. write), the argument chunks come in incrementally:
argument: "{"
argument: "\"filePath\": \"src/app.ts\","
argument: "\"content\": \"import express..."
argument: "...more code chunks..."
argument: "...more code chunks..."
← truncated here, finish_reason: "length"
At this point, the tool call arguments are incomplete JSON, so OpenCode aborts the entire tool call and the partial output is lost.
Instead of aborting, OpenCode maybe should:
Detect that finish_reason is "length" while a tool call argument is still being streamed (i.e. the JSON is unclosed).
Synthetically close the incomplete JSON argument — append the necessary closing characters (", }, etc.) to make the partial argument valid.
Treat it as a completed tool call internally, but do NOT execute it (don't actually write the file).
Show a warning to the user with the partial content that was generated so far, something like: "Tool call truncated due to output token limit. Partial content below:"
Stop the agentic loop and hand control back to the user.
This way, the user can see exactly what was generated before truncation and decide how to proceed — whether to ask the model to continue from where it left off or retry with a different approach
The key insight is: don't discard the partial streamed data. The model already generated useful content; OpenCode just needs to gracefully capture it instead of treating truncation as a fatal error.
same issue here:
~ Updating todos...
Tool execution aborted
""
github-actions commented on Jun 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
snippet-01-tool-aborted.json
snippet-02-message-finish-length.json
snippet-03-session-created.log
snippet-04-llm-model.log
snippet-05-session-cancel-1.log
snippet-06-session-cancel-2.log
Tool execution aborted when tool call is truncated (empty input)
Summary
During session "Resumen T84 antes de continuar" (
ses_3b7971163ffexUgX5mjSgXDfWQ), several tool calls ended withTool execution aborted. One concrete instance shows anedittool call with empty input ({}) that immediately fails. The same assistant message ended withfinish: "length"(output length limit), which suggests the tool call may have been truncated before arguments were fully emitted. This looks like a truncation/cancel edge case rather than an LLM transport failure.Environment
1.1.49claude-opus-4-6(azure-anthropic)ses_3b7971163ffexUgX5mjSgXDfWQEvidence (sanitized excerpts)
The following log snippets are attached in
snippets/(redacted paths):snippet-01-tool-aborted.json— tool call aborted with empty inputsnippet-02-message-finish-length.json— same message finished due to output lengthsnippet-03-session-created.log— session creation (OpenCode 1.1.49)snippet-04-llm-model.log— model/provider infosnippet-05-session-cancel-1.log— user cancellation (expected behavior)snippet-06-session-cancel-2.log— user cancellation (expected behavior)Notes / Hypothesis
inputand immediately aborted.finish: "length", which is consistent with output truncation.Expected behavior
If a tool call is truncated (missing or empty input), OpenCode should either:
Tool execution aborted.Questions for maintainers
finish: "length"and tool call emission that can cause empty-input tool calls?Related issues