From 1ac6fe740c14d6e16acbfb3dad20f5e661865b0e Mon Sep 17 00:00:00 2001 From: Alex Schapiro Date: Tue, 22 Sep 2026 19:23:40 +0000 Subject: [PATCH] Surface withdrawn reports in headless CLI output and refresh TUI on delete --- strix/interface/cli.py | 22 ++++++++++++++++++++++ strix/interface/tui/runtime.py | 3 +++ 2 files changed, 25 insertions(+) diff --git a/strix/interface/cli.py b/strix/interface/cli.py index 684805d0..a8992ce4 100644 --- a/strix/interface/cli.py +++ b/strix/interface/cli.py @@ -122,10 +122,32 @@ async def run_cli(args: Any) -> None: # noqa: PLR0915 console.print(vuln_panel) console.print() + def display_vulnerability_deleted(report: dict[str, Any]) -> None: + report_id = str(report.get("id", "unknown")) + deletion = report.get("deletion") + deletion = deletion if isinstance(deletion, dict) else {} + deleted_by = deletion.get("agent_name") or deletion.get("agent_id") or "agent" + text = Text() + text.append("Withdrawn: ", style="bold") + text.append(f"{report.get('title', '')}\n\n") + text.append(f"Deleted by {deleted_by}. ", style="dim") + text.append(str(deletion.get("reason") or "")) + console.print( + Panel( + text, + title=f"[bold yellow]{report_id.upper()} (withdrawn)", + title_align="left", + border_style="yellow", + padding=(1, 2), + ) + ) + console.print() + report_state.vulnerability_found_callback = display_vulnerability report_state.vulnerability_updated_callback = lambda report: display_vulnerability( report, updated=True ) + report_state.vulnerability_deleted_callback = display_vulnerability_deleted def cleanup_on_exit() -> None: report_state.cleanup() diff --git a/strix/interface/tui/runtime.py b/strix/interface/tui/runtime.py index a20960ce..15352c52 100644 --- a/strix/interface/tui/runtime.py +++ b/strix/interface/tui/runtime.py @@ -114,6 +114,9 @@ class GoTuiRuntime: self.report_state.vulnerability_updated_callback = lambda _report: ( self.controller.notify_changed() ) + self.report_state.vulnerability_deleted_callback = lambda _report: ( + self.controller.notify_changed() + ) self.controller.notify_changed() async def check_setup_model(self) -> None: