File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
agent-sre/src/agent_sre/slo Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ def __init__(
4040 self .action = action
4141 self .reason = reason
4242
43+ def label (self ) -> str :
44+ return self .action
45+
46+ def __str__ (self ) -> str :
47+ return self .reason if self .reason else self .action
48+
4349
4450def _make_engine (
4551 decision : _StubDecision | None = None ,
@@ -161,7 +167,7 @@ def test_passes_agent_id_to_engine(self):
161167 {"agent_id" : "agent-5" , "action" : "write" , "context" : {"key" : "val" }}
162168 )
163169 call_args = engine .evaluate .call_args
164- assert call_args [0 ][0 ] == "agent-5 "
170+ assert call_args [0 ][0 ] == "write "
165171
166172 def test_audit_logger_called (self ):
167173 handler = _make_handler (with_audit = True )
Original file line number Diff line number Diff line change 77import json
88import sqlite3
99import threading
10- import time
1110from abc import ABC , abstractmethod
1211from contextlib import contextmanager
1312from pathlib import Path
@@ -133,7 +132,7 @@ def _validate_db_path(raw: str) -> str:
133132
134133 Returns the normalised, resolved path string.
135134 """
136- import os , tempfile as _tempfile
135+ import tempfile as _tempfile
137136
138137 if raw == ":memory:" :
139138 return raw
You can’t perform that action at this time.
0 commit comments