feat: harden seat intent and expand HIL coverage

This commit is contained in:
vee
2026-08-02 05:20:38 +08:00
parent 4aded5c21d
commit 55d0d400cb
62 changed files with 53112 additions and 1748 deletions
+6 -3
View File
@@ -6,7 +6,7 @@ import os
from pathlib import Path
def load_local_env(path: Path) -> None:
def load_local_env(path: Path, *, override: bool = False) -> None:
if not path.is_file():
return
for raw_line in path.read_text(encoding="utf-8").splitlines():
@@ -18,6 +18,9 @@ def load_local_env(path: Path) -> None:
value = value.strip()
if value[:1] == value[-1:] and value.startswith(("'", '"')):
value = value[1:-1]
if key:
os.environ.setdefault(key, value)
if key and (override or not os.environ.get(key, "").strip()):
# A number of launchers export optional variables as empty strings.
# Treat those exactly like an unset value so a deliberate local
# development configuration is not silently shadowed.
os.environ[key] = value