Skip trace work when disabled; share the agent span builder

With TRACES_ENABLED off, LLM calls record no GenAI metrics, and a streamed
answer is joined into a preview only when a span keeps it. Agent runs and
continuations build their invoke_agent span in one place, which now reads
the model from model_id. The trace panel shows a stream's model time next
to how long it was open. Adds missing type hints.
This commit is contained in:
arc53-machine committed 2026-09-23 22:09:58 +01:00
1 parent 699906a015
commit 0bbbac0eb2
18 files changed
+88 -35

No files matched your search

+2
View File
@@ -245,6 +245,8 @@ class TestContinuation:
tool_span = trace.spans[1]
assert agent_span.kind == tracing.KIND_AGENT
assert agent_span.attributes["docsgpt.continuation"] is True
assert agent_span.attributes["gen_ai.request.model"] == "gpt-4"
assert agent_span.name == "invoke_agent ClassicAgent"
assert agent_span.status == "ok"
assert tool_span.parent_id == agent_span.id
assert tool_span.status == "denied"