Skip to content

Commit b8c68d2

Browse files
olivermeyerclaude
andcommitted
fix(gui): avoid asyncio.run() and cpu_bound for async health checks
Move SystemService.health_static() call from the sync inner function _add_application_version_selection_section() to the outer async _page_application_describe(), capturing the result via closure. Also fix gui/_frame.py to await health_static() directly instead of passing it to run.cpu_bound(), which ran the async function in a subprocess with no event loop, causing "coroutine was never awaited". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c7a00eb commit b8c68d2

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/aignostics/application/_gui/_page_application_describe.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Application describe page, including submission stepper."""
22

3-
import asyncio
43
import sys
54
import time
65
from datetime import UTC, datetime, timedelta
@@ -108,6 +107,7 @@ async def _page_application_describe(application_id: str) -> None: # noqa: C901
108107
type="positive",
109108
)
110109
spinner.set_visibility(False)
110+
system_healthy = bool(await SystemService.health_static())
111111

112112
if application is None:
113113
await _frame(
@@ -302,8 +302,6 @@ def _add_application_version_selection_section() -> None:
302302
with ui.column(), ui.button(icon="info", on_click=info_dialog.open):
303303
ui.tooltip("Show changes and input/ouput schema of this application version.")
304304
with ui.stepper_navigation():
305-
# Check system health and determine if force option should be available
306-
system_healthy = bool(asyncio.run(SystemService.health_static()))
307305
unhealthy_tooltip = None
308306
with ui.button(
309307
"Next",

src/aignostics/gui/_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def health_link() -> None:
204204
async def _health_load_and_render() -> None:
205205
nonlocal launchpad_healthy
206206
with contextlib.suppress(Exception):
207-
launchpad_healthy = bool(await run.cpu_bound(SystemService.health_static))
207+
launchpad_healthy = bool(await SystemService.health_static())
208208
health_icon.refresh()
209209
health_link.refresh()
210210

0 commit comments

Comments
 (0)