Issue
When webfetch times out, its span remains open until the turn ends.
- Configured timeout: 5 seconds
- Reported latency: 18.44 seconds
- Output:
undefined
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
Issue
When
webfetchtimes out, its span remains open until the turn ends.undefinedCause
tool.execute.beforestarts the span, buttool.execute.afteris not emitted on timeout.OpenCode instead emits
message.part.updatedwith:part.type = "tool"part.state.status = "error"part.state.time.endThe plugin does not handle this error event, so subsequent model processing is included in the tool latency.
Expected
On tool error, the plugin should:
part.state.time.endERRORpart.state.error