Skip to content

Tool span reports incorrect latency after timeout #10

Description

@csh-scl

Issue

When webfetch times out, its span remains open until the turn ends.

  • Configured timeout: 5 seconds
  • Reported latency: 18.44 seconds
  • Output: undefined
Image

Cause

tool.execute.before starts the span, but tool.execute.after is not emitted on timeout.

OpenCode instead emits message.part.updated with:

  • part.type = "tool"
  • part.state.status = "error"
  • part.state.time.end

The plugin does not handle this error event, so subsequent model processing is included in the tool latency.

Expected

On tool error, the plugin should:

  • End the span at part.state.time.end
  • Mark it as ERROR
  • Record part.state.error

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions