mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-17 08:13:59 +00:00
Keep trace summaries from breaking Logs and fix their counts
A failed trace-summary lookup now leaves the Logs page intact without chips. Tool-call counts include only calls that ran, not their paused, denied or skipped records. A local guardrail that fires unchanged on every streamed segment is recorded once, so it cannot use up the span cap.
This commit is contained in:
1 parent
24796ae61f
commit
9f7f0b2f1e
7 files changed
+134
-19
No files matched your search
@@ -388,6 +388,16 @@ class TestTraceSpans:
|
||||
assert span.attributes["docsgpt.guardrail.triggered"] == ["_test_always"]
|
||||
assert self.trace.content_blocked is True
|
||||
|
||||
def test_a_repeating_firing_is_recorded_once(self):
|
||||
"""The output guard re-scans every segment; one firing must not fill the span cap."""
|
||||
engine = GuardrailEngine(
|
||||
_config(controls=[{"check": "_test_always", "stage": "output", "action": "flag"}])
|
||||
)
|
||||
for _ in range(50):
|
||||
engine.evaluate("segment", Stage.OUTPUT)
|
||||
assert len(self.trace.spans) == 1
|
||||
assert self.trace.content_blocked is True
|
||||
|
||||
def test_remote_scan_is_traced_with_judge_nested(self):
|
||||
engine = GuardrailEngine(
|
||||
_config(controls=[{"check": "_test_quick_remote", "stage": "input", "action": "block"}])
|
||||
|
||||
Reference in new issue
Block a user