Keep tool output out of span errors and fix trace status and listing

Tool results, denial comments and tool exception text now reach a span only
as a capture-gated preview; span.error is a fixed message, since it is
stored and exported regardless of content settings. A turn whose stream
yields an error event is recorded as failed. Search traces are listed by a
query copied into the small summary column, so the Logs timeline never
reads the spans JSONB. Adds GraphRAG span tests.
This commit is contained in:
arc53-machine committed 2026-09-23 18:11:19 +01:00
1 parent 285fdc914c
commit efec1a2f83
9 files changed
+134 -13

No files matched your search

+9 -1
View File
@@ -431,6 +431,14 @@ class Trace:
def to_record(self) -> Dict[str, Any]:
"""The ``request_traces`` row for this (finished) trace."""
summary = self.summary()
# Traces without a log row of their own (searches) are listed by
# their query; keep it in the small summary so listing never reads
# ``spans``. Dropped with the other previews when content is blocked.
if not self.content_blocked and self.spans:
query = self.spans[0].previews.get("query")
if isinstance(query, str):
summary["query"] = query
spans = []
for s in self.spans:
entry: Dict[str, Any] = {
@@ -464,7 +472,7 @@ class Trace:
"duration_ms": int(round(self.duration_ms or 0)),
"span_count": len(spans),
"dropped_spans": self.dropped_spans,
"summary": self.summary(),
"summary": summary,
"spans": spans,
"otel_trace_id": self.otel_trace_id,
}