From 24d5bda1ef2ff1cef51319c0506c9f385081e9e0 Mon Sep 17 00:00:00 2001 From: 0-CYBERDYNE-SYSTEMS-0 Date: Wed, 8 Jul 2026 17:32:19 +0530 Subject: [PATCH] fix(dashboard): run GET /api/sessions session-DB read off the event loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flip the handler from async def to sync def so FastAPI executes it in its threadpool: the SessionDB open + list_sessions_rich query no longer block the single uvicorn event loop. Residual hunk from PR #53966 — that PR's get_profiles_sessions flip already landed via #54523/1bb7b59c5, and its get_status offload is superseded by #58238's read_only + timeout variant in this branch. (cherry picked from commit 414c12a40db07b941b0c589674bc6aad3f090ff7) --- hermes_cli/web_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 2c324e547ee..c5978ebfff4 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -3830,7 +3830,7 @@ async def get_action_status(name: str, lines: int = 200): @app.get("/api/sessions") -async def get_sessions( +def get_sessions( limit: int = 20, offset: int = 0, min_messages: int = 0,