fix preflight config path check

This commit is contained in:
ykcheungab
2026-09-20 11:20:47 +08:00
parent 45419a59c4
commit e2b906a640
3 changed files with 104 additions and 33 deletions
+11 -1
View File
@@ -103,7 +103,17 @@ def _runtime_roots() -> list[Path]:
except (OSError, ValueError): # pragma: no cover - defensive
continue
return [path for path in _unique_paths(anchors) if _is_sdk_runtime_root(path)]
anchors = _unique_paths(anchors)
# Keep the *innermost* matching directories. Walking up from the launcher
# also visits every parent, and a parent that happens to carry an
# ``examples/`` directory must not outrank the real root below it: doing so
# made a workspace directory shadow the release root's own bundle.
return [
path
for path in anchors
if _is_sdk_runtime_root(path)
and not any(other != path and other.is_relative_to(path) for other in anchors)
]
def _candidate_config_dirs() -> list[Path]: