From 415a3c59522789c626213358bde04b614949277f Mon Sep 17 00:00:00 2001 From: Chris Krough <461869+ckrough@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:36:02 -0500 Subject: [PATCH] fix: resolve NoActiveWorker error in TUI workspace removal Add @work() decorator to action_remove method to provide required worker context for push_screen_wait() async operation. The decorator enables Textual's message pump to properly suspend and resume the async action when displaying the confirmation modal. Fixes: NoActiveWorker exception when pressing 'd' key in TUI Impact: Workspace removal via TUI now works correctly Changes: - Add 'from textual import work' import - Add @work() decorator to action_remove method --- src/agentspaces/ui/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agentspaces/ui/app.py b/src/agentspaces/ui/app.py index b255919..8fabb44 100644 --- a/src/agentspaces/ui/app.py +++ b/src/agentspaces/ui/app.py @@ -6,6 +6,7 @@ from typing import TYPE_CHECKING, ClassVar import structlog +from textual import work from textual.app import App from textual.binding import Binding from textual.widgets import DataTable, Footer @@ -195,6 +196,7 @@ async def action_navigate(self) -> None: severity="information", ) + @work() async def action_remove(self) -> None: """Remove selected workspace(s) after confirmation.""" # Determine which workspaces to remove