HKUDS/nanobot · error · ValueError
token_issue_path must start with "/"
Error message
token_issue_path must start with "/"
What it means
In WebSocketConfig.token_issue_path_format, the optional token_issue_path is non-empty but does not start with '/'. It must be a valid HTTP route (origin-form path) so a GET can fetch short-lived tokens; the input at fault is the token_issue_path string.
Solutions
- Set token_issue_path to a slash-prefixed route, e.g. '/token-issue'
- Leave it empty ('') if the token issue endpoint is not wanted
- Ensure it also differs from the WebSocket upgrade path
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/channels/websocket/runtime.py:250 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26).
Data as JSON: /api/errors/f6233b49b00c063b.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/channels/websocket/runtime.py:250
if not path.is_absolute():
raise ValueError("unix_socket_path must be an absolute path")
return str(path)
@field_validator("path")
@classmethod
def path_must_start_with_slash(cls, value: str) -> str:
if not value.startswith("/"):
raise ValueError('path must start with "/"')
return _normalize_config_path(value)
@field_validator("token_issue_path")
@classmethod
def token_issue_path_format(cls, value: str) -> str:
value = value.strip()
if not value:
return ""
if not value.startswith("/"):
raise ValueError('token_issue_path must start with "/"')
return _normalize_config_path(value)
@field_validator("public_ws_url")
@classmethod
def public_ws_url_format(cls, value: str) -> str:
value = value.strip()
if not value:
return ""
parsed = urlsplit(value)
if (
parsed.scheme not in {"ws", "wss"}
or not parsed.netloc
or parsed.username is not None
or parsed.password is not None
or parsed.query
or parsed.fragment
):
raise ValueError("public_ws_url must be an absolute ws:// or wss:// URL without credentials")View on GitHub (pinned to 42f37dc4c0)