Skip to content

Tool execution aborted when tool call is truncated (empty input) #13102

@cjmayoral

Description

@cjmayoral

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 with Tool execution aborted. One concrete instance shows an edit tool call with empty input ({}) that immediately fails. The same assistant message ended with finish: "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

  • OpenCode version: 1.1.49
  • OS: Windows
  • Model: claude-opus-4-6 (azure-anthropic)
  • Session title: "Resumen T84 antes de continuar"
  • Session ID: ses_3b7971163ffexUgX5mjSgXDfWQ

Evidence (sanitized excerpts)

The following log snippets are attached in snippets/ (redacted paths):

  1. snippet-01-tool-aborted.json — tool call aborted with empty input

  2. snippet-02-message-finish-length.json — same message finished due to output length

  3. snippet-03-session-created.log — session creation (OpenCode 1.1.49)

  4. snippet-04-llm-model.log — model/provider info

  5. snippet-05-session-cancel-1.log — user cancellation (expected behavior)

  6. snippet-06-session-cancel-2.log — user cancellation (expected behavior)

Notes / Hypothesis

  • The tool call is emitted with empty input and immediately aborted.
  • The corresponding assistant message ended with finish: "length", which is consistent with output truncation.
  • This suggests OpenCode may attempt to execute a tool call even when its arguments are incomplete due to truncation.

Expected behavior

If a tool call is truncated (missing or empty input), OpenCode should either:

  • retry the model to complete the tool arguments, or
  • skip tool execution with a clearer error (e.g., "tool call incomplete due to output length"), instead of Tool execution aborted.

Questions for maintainers

  • Is there a guard that detects incomplete tool call payloads before execution?
  • Is there a known interaction between finish: "length" and tool call emission that can cause empty-input tool calls?

Related issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

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