Skip to content

Commit 15d498e

Browse files
committed
fix(skills): prioritize stripped relative path resolution
1 parent 1c8f1e1 commit 15d498e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/google/adk/skills/_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ def _resolve_skill_dir_path(skill_dir: Union[str, pathlib.Path]) -> pathlib.Path
5353
return path.resolve()
5454

5555
cwd = pathlib.Path.cwd()
56-
candidates = [cwd / path]
56+
candidates = []
5757

5858
if path.parts and path.parts[0] == cwd.name:
5959
stripped = pathlib.Path(*path.parts[1:])
6060
candidates.append(cwd / stripped)
6161

62-
candidates.append(cwd.parent / path)
62+
candidates.append(cwd / path)
6363

6464
for candidate in candidates:
6565
if candidate.exists():
6666
return candidate.resolve()
6767

68-
return candidates[0].resolve()
68+
return candidates[-1].resolve()
6969

7070

7171
def _load_dir(directory: pathlib.Path) -> dict[str, str]:

0 commit comments

Comments
 (0)