Describe the Bug
When a tool errors, @flue/opentelemetry (1.0.0-beta.3, with @flue/runtime
1.0.0-beta.9) produces an ERROR span that carries no error text anywhere:
-
exception.message is empty. The runtime's tool-end observation
(type: 'tool') includes errorInfo: FlueErrorInfo, whose message field
contains the real error text (populated by classifyError from the thrown
Error). The tool-end handler ignores it: it builds the exception via
errorMessage(event.result), and on error event.result is the
model-facing content array ([{type: 'text', text: ...}]), which
errorMessage (string / .message object only) cannot unwrap. So
recordException fires with an empty message while the message sits unused
in event.errorInfo.message.
-
The span status has no message. complete() calls
span.setStatus({ code: SpanStatusCode.ERROR }) without a message.
Trace UIs that render status.message (e.g. Arize Phoenix's spans-table
"error" column) show nothing for error spans.
Expected Behavior
For an errored tool span, the exception event's exception.message should
contain errorInfo.message, and ideally the same text should be passed as
the message in setStatus, e.g. in the tool-end handler prefer
event.errorInfo?.message over deriving from event.result.
Steps to Reproduce
- Create a basic flue app with the OpenTelemetry instrumentation registered
(instrument(createOpenTelemetryInstrumentation({ content: { enabled: true, inline: true } })))
and an InMemorySpanExporter on the tracer provider.
- Register a tool whose
execute throws:
throw new Error('bridge timed out after 20s').
- Run a conversation turn that calls the tool, then inspect the finished
execute_tool span: span.status is { code: ERROR } with no message,
and the recorded exception event has an empty exception.message —
the text "bridge timed out after 20s" appears nowhere on the span, even
though the tool-end observation's errorInfo.message contains it.
Describe the Bug
When a tool errors,
@flue/opentelemetry(1.0.0-beta.3, with@flue/runtime1.0.0-beta.9) produces an ERROR span that carries no error text anywhere:
exception.messageis empty. The runtime's tool-end observation(
type: 'tool') includeserrorInfo: FlueErrorInfo, whosemessagefieldcontains the real error text (populated by
classifyErrorfrom the thrownError). The tool-end handler ignores it: it builds the exception viaerrorMessage(event.result), and on errorevent.resultis themodel-facing content array (
[{type: 'text', text: ...}]), whicherrorMessage(string /.messageobject only) cannot unwrap. SorecordExceptionfires with an empty message while the message sits unusedin
event.errorInfo.message.The span status has no message.
complete()callsspan.setStatus({ code: SpanStatusCode.ERROR })without amessage.Trace UIs that render
status.message(e.g. Arize Phoenix's spans-table"error" column) show nothing for error spans.
Expected Behavior
For an errored tool span, the exception event's
exception.messageshouldcontain
errorInfo.message, and ideally the same text should be passed asthe
messageinsetStatus, e.g. in the tool-end handler preferevent.errorInfo?.messageover deriving fromevent.result.Steps to Reproduce
(
instrument(createOpenTelemetryInstrumentation({ content: { enabled: true, inline: true } })))and an
InMemorySpanExporteron the tracer provider.executethrows:throw new Error('bridge timed out after 20s').execute_toolspan:span.statusis{ code: ERROR }with no message,and the recorded
exceptionevent has an emptyexception.message—the text "bridge timed out after 20s" appears nowhere on the span, even
though the tool-end observation's
errorInfo.messagecontains it.