refactor: preserve origin session routing for cron

This commit is contained in:
chengyongru
2026-06-12 14:21:09 +08:00
parent bc18142650
commit c4b64a4caf
10 changed files with 179 additions and 42 deletions
+1 -7
View File
@@ -139,7 +139,6 @@ class GatewayHTTPHandler:
runtime_model_name: Callable[[], str | None] | None,
runtime_surface: str,
runtime_capabilities_overrides: dict[str, Any] | None,
unified_session: bool = False,
bus: MessageBus,
tokens: GatewayTokenStore,
media: WebUIMediaGateway,
@@ -162,7 +161,6 @@ class GatewayHTTPHandler:
self.cron_service = cron_service
self._log = log
self._runtime_surface = runtime_surface
self._unified_session = unified_session
from nanobot.webui.settings_api import runtime_capabilities as _rc
from nanobot.webui.settings_routes import WebUISettingsRouter
@@ -439,7 +437,7 @@ class GatewayHTTPHandler:
if not _is_websocket_channel_session_key(decoded_key):
return _http_error(404, "session not found")
return _http_json_response(
session_automations_payload(self.cron_service, self._automation_display_key(decoded_key))
session_automations_payload(self.cron_service, decoded_key)
)
def _handle_session_delete(self, request: WsRequest, key: str) -> Response:
@@ -470,10 +468,6 @@ class GatewayHTTPHandler:
delete_webui_thread(decoded_key)
return _http_json_response({"deleted": bool(deleted)})
def _automation_display_key(self, session_key: str) -> str:
"""Return the cron ownership key shown for this WebUI thread."""
return session_key
# -- Media routes -------------------------------------------------------
def _dispatch_media_routes(self, request: WsRequest, got: str) -> Response | None: