Skip to content

Persisted submissions omit final text from terminal telemetry #621

Description

@SilasMarvin

Describe the Bug

In Flue v2.0.3, a successful persisted agent submission (processSubmissionInput, used by HTTP and dispatch() paths) emits a terminal operation observation without agentOutput. This diverges from a successful freeform session.prompt() operation.

Both @flue/opentelemetry and Flue's Cloudflare tracing project terminal text agentOutput into gen_ai.output.messages. Consequently, the persisted parent agent span contains the input but not the final assistant response.

This report is limited to freeform text output. Structured result data and response metadata are not currently projected into gen_ai.output.messages for direct prompts, tasks, or persisted submissions.

Expected Behavior

A successful persisted freeform submission emits terminal text agentOutput for its final assistant response through the same live-observation and GenAI projection contract used by a successful freeform session.prompt() operation.

This should not redefine the durable submission reply contract (text, data, and metadata) or add structured data or metadata to gen_ai.output.messages only for persisted submissions.

Steps to Reproduce

  1. Use @flue/runtime@2.0.3 and configure Flue OpenTelemetry instrumentation with a span exporter.
  2. Run an agent with a deterministic/local OpenAI-compatible model through the persisted HTTP or dispatch() submission path.
  3. Let the agent complete a normal freeform text response.
  4. Inspect the terminal parent operation / invoke_agent span.
  5. Observe that gen_ai.input.messages is present but gen_ai.output.messages is absent.
  6. Run an equivalent freeform session.prompt() operation and inspect its terminal parent span. It includes gen_ai.output.messages with the final assistant text.

Additional Evidence

In v2.0.3, the persisted path flushes the response successfully, but returns no result to its enclosing runOperation('prompt', ...). The operation's terminal observation therefore cannot normalize an agentOutput. The direct freeform prompt path returns a text result through that same operation boundary.

A local real-Flue reproduction against the affected runtime with a mock OpenAI-compatible streaming model and a file-backed OpenTelemetry span processor confirmed the difference: the unmodified persisted path omitted the parent output; providing the final text at the existing operation boundary populated gen_ai.output.messages.

Example implementation: SilasMarvin#2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions