Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: prevent ScreenStackError when stopping agent from modal
Move pop_screen() into on_button_pressed before dispatching the stop
action, and remove the redundant pop in action_confirm_stop_agent.
This avoids a double-pop that crashes when the screen stack has only
the default screen left.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
0xallam and claude committed Mar 20, 2026
commit 04f11870cf5301923f445d5aac2c7c678c78b619
5 changes: 1 addition & 4 deletions strix/interface/tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,9 @@ def on_key(self, event: events.Key) -> None:
event.prevent_default()

def on_button_pressed(self, event: Button.Pressed) -> None:
self.app.pop_screen()
if event.button.id == "stop_agent":
self.app.action_confirm_stop_agent(self.agent_id)
else:
self.app.pop_screen()


class VulnerabilityDetailScreen(ModalScreen): # type: ignore[misc]
Expand Down Expand Up @@ -1912,8 +1911,6 @@ def _validate_agent_for_stopping(self) -> tuple[str, bool]:
return agent_name, False

def action_confirm_stop_agent(self, agent_id: str) -> None:
self.pop_screen()

try:
from strix.tools.agents_graph.agents_graph_actions import stop_agent

Expand Down