mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-07 08:02:23 +00:00
fix(kanban): honor severity thresholds in diagnostics
Salvages #26431 by @LeonSGP43. Dashboard plugin_api list_diagnostics was using exact-match (severity == filter), so '--severity warning' hid 'error' and 'critical' diagnostics. Adds severity_at_or_above() helper to kanban_diagnostics and uses it in the dashboard endpoint (CLI already used SEVERITY_ORDER comparison correctly).
This commit is contained in:
parent
9f008bcd5c
commit
a94ddd8073
3 changed files with 22 additions and 1 deletions
|
|
@ -41,6 +41,15 @@ import time
|
|||
SEVERITY_ORDER = ("warning", "error", "critical")
|
||||
|
||||
|
||||
def severity_at_or_above(severity: Optional[str], threshold: Optional[str]) -> bool:
|
||||
"""Return True when ``severity`` meets or exceeds ``threshold``."""
|
||||
if threshold is None:
|
||||
return True
|
||||
if severity not in SEVERITY_ORDER or threshold not in SEVERITY_ORDER:
|
||||
return False
|
||||
return SEVERITY_ORDER.index(severity) >= SEVERITY_ORDER.index(threshold)
|
||||
|
||||
|
||||
@dataclass
|
||||
class DiagnosticAction:
|
||||
"""A single recovery action attached to a diagnostic.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue