[Feature] Emit runImage attempts as trace spans

Author: JackChen-meCreated Sep 23, 2026Updated Sep 23, 2026
LabelsenhancementP3source:analysis

Context

runImage() (#610) reports every provider call through onAttempt and result.attempts, but not through onTrace or the OpenTelemetry adapter. An application that already exports OMA traces has to wire image attempts into its tracing by hand, and a run's trace shows a gap where the image call happened.

Proposal

  • Add an image_call trace event type carrying provider, model, attempt numbers, status, error type, and output format and size. No image bytes.
  • Let runImage() accept the trace context an agent run uses (onTrace, run ID, parent span), so a call made from a tool or a task nests under that span.
  • Map the event in @open-multi-agent/otel and show it in the Run Viewer span waterfall.
  • Keep the observability invariant: a failing trace sink never changes or delays the result.

Open questions

  • Whether a whole runImage() call gets its own parent span with one child span per attempt, or only attempts are emitted.
  • Which run ID and agent name a standalone call reports, since TraceEventBase requires both and a direct call has no surrounding run.

Why not now

onAttempt already covers applications that store attempt records themselves. This becomes worth doing when image calls need to appear inside an existing OMA trace pipeline.

Split from #469.

Source: open-multi-agent/open-multi-agent