fix: Python 3.9 compat — replace str | None with Optional[str] in serve.py

The `str | None` union syntax at module level requires Python 3.10+.
serve.py cannot use `from __future__ import annotations` because it
defines Pydantic models inside functions (FastAPI needs runtime types).
This commit is contained in:
Alpamys 2026-04-03 13:02:20 +05:00
parent dee9317dde
commit f3c2dda9f2
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ def _validate_adapter_name(name: str) -> bool:
return bool(re.match(r'^[a-zA-Z0-9][a-zA-Z0-9\-]*$', name))
def _validate_adapter_path(path: str, cwd: str | None = None) -> bool:
def _validate_adapter_path(path: str, cwd: Optional[str] = None) -> bool:
"""Validate adapter path: must exist and stay under cwd."""
if cwd is None:
cwd = str(Path.cwd())