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

+19
View File
@@ -353,3 +353,22 @@ class TestOutcome:
trace.outcome = "paused"
trace.finish(status="error")
assert trace.status == "error"
class TestRecordQuery:
def test_first_span_query_is_copied_into_summary(self):
trace = tracing.start_trace(source="search")
with tracing.activate(trace):
with tracing.span(tracing.KIND_RETRIEVAL, "retrieval") as s:
s.preview("query", "how do I deploy")
trace.finish()
assert trace.to_record()["summary"]["query"] == "how do I deploy"
def test_query_is_dropped_when_content_is_blocked(self):
trace = tracing.start_trace(source="search")
with tracing.activate(trace):
with tracing.span(tracing.KIND_RETRIEVAL, "retrieval") as s:
s.preview("query", "leaky")
tracing.mark_content_blocked()
trace.finish()
assert "query" not in trace.to_record()["summary"]