Skip to content

Record every LLM call in the trace - #68

Merged
vitramir merged 1 commit into
mainfrom
trace-every-llm-call
Aug 4, 2026
Merged

Record every LLM call in the trace#68
vitramir merged 1 commit into
mainfrom
trace-every-llm-call

Conversation

@vitramir

@vitramir vitramir commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

A call that returned no assistant text emitted no span:

if callIndex == 0 || text != "" {
    a.recordLLMSpan(...)
}

So a turn read as ending on a tool call, with no LLM call after it — which is impossible, and is what made the reported trace look wrong. Those are exactly the calls worth seeing: they end turns and still cost tokens (usage_output=4 per attempt in the retry storm).

The stated intent was avoiding duplicated context events across a tool-call loop. That only requires dropping the events, not the span.

A call that returned no assistant text emitted no span, so a turn whose
last call came back empty read as ending on a tool call. Those are the
calls worth seeing -- they end turns and still cost tokens. Only the
context events stay on the first call; they repeat verbatim.
@vitramir
vitramir merged commit fd158ed into main Aug 4, 2026
1 of 2 checks passed
@vitramir
vitramir deleted the trace-every-llm-call branch August 4, 2026 16:21
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