From f473cd9927f7d19c7d9c1ee7b139eae27fffc9fe Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Sun, 22 Nov 2026 14:44:44 +0800 Subject: [PATCH] fix(agents): give Codex skill paths one separator on Windows (#5158) Skill roots are joined as `.agents/skills`, so a SKILL.md path that could not be canonicalized kept a forward slash on Windows and failed hub_staging_hands_each_cli_its_own_tree. Rebuild the path from its components before handing it to Codex. --- crates/ide-agent/src/skills.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/ide-agent/src/skills.rs b/crates/ide-agent/src/skills.rs index dff3d2b28..4c7ef1429 100644 --- a/crates/ide-agent/src/skills.rs +++ b/crates/ide-agent/src/skills.rs @@ -662,11 +662,12 @@ pub fn stage( /// Codex `[[skills.config]]` matches `path` against the canonical `SKILL.md` document path. fn codex_skill_md_path(skill_dir: &Path) -> String { let md = skill_dir.join("SKILL.md"); - dunce::canonicalize(&md) + let md = dunce::canonicalize(&md) .or_else(|_| dunce::canonicalize(skill_dir).map(|dir| dir.join("SKILL.md"))) - .unwrap_or(md) - .to_string_lossy() - .into_owned() + .unwrap_or(md); + // Skill roots are joined as `.agents/skills`; rebuilding from components gives Windows + // one separator when the path could not be canonicalized. + md.components().collect::().to_string_lossy().into_owned() } fn direct_link_matches(root: &Path, name: &str, target: &Path) -> bool {