Skip to content

[observability] Sub-agent internal steps not traced to Langfuse — delegated runs are opaque single spans #4657

Description

@M3gA-Mind

Part of #4654. Surfaced by Langfuse tracing (staging, 2026-07-07).

Problem: when the orchestrator delegates to a sub-agent (e.g. retrieve_memory, manage_profile_memory), the sub-agent's internal work is not emitted as nested Langfuse observations or a linked child trace. In the parent trace it appears as a single opaque SPAN with only the aggregate input/output; the sub-agent's own model calls and tool-call loop — the thing that actually consumed 81s and hit the tool-call limit — are invisible.

Evidence (trace thread-5e39f26f-51fa-4d8d-b813-d6b5a9572aba:b1546030-5ed4-4c82-833a-3f443be6f8bd): one retrieve_memory SPAN (81s), no child observations, no separate sub-agent trace in the same time window / session. Root-causing the incomplete run required parsing the span's text output rather than reading spans.

Fix: project sub-agent (spawned) runs into Langfuse as nested observations under the parent span (or as a linked child trace with parent/root run correlation), so each sub-agent model call + tool call is its own generation/span. This is the harness parent/root event-correlation surface (relates to the observability items in the TinyAgents audit #4632).

Impact: delegated/sub-agent behavior — the most interesting and failure-prone part — can't be observed or debugged in Langfuse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions