Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix: handler token issue also checks static token as fallback
chengyongru2420826e058c
diff --git a/nanobot/channels/websocket.py b/nanobot/channels/websocket.pyindex 6b1308c11..231f763ca 100644--- a/nanobot/channels/websocket.py+++ b/nanobot/channels/websocket.py@@ -14,7 +14,7 @@ from collections.abc import Callablefrom contextlib import suppressfrom functools import partialfrom pathlib import Path-from typing import TYPE_CHECKING, Any, Self+from typing import Any, Selffrom urllib.parse import parse_qs, unquote, urlparsefrom loguru import logger@@ -28,7 +28,7 @@ from websockets.http11 import Responsefrom nanobot.bus.events import OUTBOUND_META_AGENT_UI, OutboundMessagefrom nanobot.bus.queue import MessageBusfrom nanobot.channels.base import BaseChannel-from nanobot.config.paths import get_media_dir, get_workspace_path+from nanobot.config.paths import get_media_dirfrom nanobot.config.schema import Basefrom nanobot.security.workspace_access import (WORKSPACE_SCOPE_METADATA_KEY,@@ -44,9 +44,6 @@ from nanobot.webui.cli_apps_api import normalize_cli_app_mentionsfrom nanobot.webui.mcp_presets_api import normalize_mcp_preset_mentionsfrom nanobot.webui.transcript import append_transcript_object-if TYPE_CHECKING:- from nanobot.session.manager import SessionManager-def _strip_trailing_slash(path: str) -> str:if len(path) > 1 and path.endswith("/"):diff --git a/nanobot/webui/ws_http.py b/nanobot/webui/ws_http.pyindex 572ad4c6a..1d6f35b5e 100644--- a/nanobot/webui/ws_http.py+++ b/nanobot/webui/ws_http.py@@ -380,7 +380,7 @@ class GatewayHTTPHandler:# -- Token issue --------------------------------------------------------def _handle_token_issue(self, connection: Any, request: Any) -> Any:- secret = self.config.token_issue_secret.strip()+ secret = self.config.token_issue_secret.strip() or self.config.token.strip()if secret:if not _issue_route_secret_matches(request.headers, secret):return connection.respond(401, "Unauthorized")