Skip to content

Feat/span kind - #32

Merged
RobinXL merged 2 commits into
mainfrom
feat/span-kind
Aug 26, 2026
Merged

Feat/span kind#32
RobinXL merged 2 commits into
mainfrom
feat/span-kind

Conversation

@RobinXL

@RobinXL RobinXL commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

No description provided.

RobinXL and others added 2 commits August 26, 2026 01:17
The tracer knew what every span was and said so for exactly one of them.
record_retrieval stamped metadata.kind = "retrieval", because the RAG
judges needed {context} and nothing else would do. Tool spans and LLM
spans carried no marker at all, so the backend guessed - and the UI's
guess ended in "everything else is a tool", which drew tool calls that
never happened.

child_span now takes span_kind and puts it on the wire, and the three
places that already know stamp it: trace_tool_call and the merged
framework tool calls say "tool", merged LLM steps say "llm", retrievals
say "retrieval" alongside the metadata they already wrote. The LangChain
handler's own span tree does the same, including "chain" for the graph
nodes it emits.

The flat tool_calls dual-write is untouched. That list is what the
engine's Tool failure check reads and it is a different thing from the
span's kind - one is "this interaction made these calls", the other is
"this span is a call".

Nothing here is required: a span that says nothing still classifies the
way it did, by the backend's fallback ladder. Stating it just means the
answer stops depending on whether the span happened to be named
"LLM Call N".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
child_span took span_kind; tracer.trace() did not, so the one span that
most often knows what it is - the root - had no way to say. An agentic
turn and a single flat LLM call both arrive as a root carrying a model,
and the engine deliberately refuses to guess between them from structure
alone, which leaves saying so as the only way to tell them apart.

    with client.tracer.trace("rag-agent", span_kind="agent") as span:

Optional, as everywhere else: a root that says nothing classifies the
way it always did.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@RobinXL
RobinXL merged commit f9798f0 into main Aug 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant