From bb3a5aa594ffd34259ecabd7392fd627fa2109a7 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 22 Oct 2026 22:21:58 +0000 Subject: fix(sdd): print a Windows-readable workspace path (#2307) On Windows, sdd-workspace printed the workspace in MSYS form (/c/Users/... or /tmp/...). Every helper path derives from that line: task-brief's "wrote", review-package's diff path, executing-plans' task-start "brief:". PowerShell resolves /c/Users/x as C:\c\Users\x, so Test-Path and Get-Content on any of them failed. That is the shell an agent gets from Claude Code's PowerShell tool and from Copilot CLI on Windows. Reproduced on Windows 11 from PowerShell and from Claude Code 2.1.308's PowerShell tool. When cygpath is present (Git Bash, MSYS2, Cygwin), print the path through `cygpath -m`, which gives C:/Users/.... PowerShell, cmd and Claude Code's Read tool all accept that form, and so does bash, so the sibling scripts that build file names on top of it keep working. Elsewhere the output is unchanged. Only the printed line changes. The plan-path markers keep pwd -P's spelling, so workspaces created before this change, including absolute markers for out-of-repo plans, still match their plans. PR #2369 converted root and the plan path too, which would rewrite those absolute markers and orphan existing workspaces for out-of-repo plans. Tests: physical_path in both suites now spells paths the way the scripts print them, and test-sdd-workspace adds a check that PowerShell can open the printed workspace and brief paths. That check runs on Windows and is a no-op elsewhere. On Windows the suites failed 10 and 1 assertions before the fix, and both pass after. Co-authored-by: hzxxxx Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba --- skills/subagent-driven-development/scripts/sdd-workspace | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'skills/subagent-driven-development/scripts') diff --git a/skills/subagent-driven-development/scripts/sdd-workspace b/skills/subagent-driven-development/scripts/sdd-workspace index b4661eb..77ef8a2 100755 --- a/skills/subagent-driven-development/scripts/sdd-workspace +++ b/skills/subagent-driven-development/scripts/sdd-workspace @@ -84,4 +84,11 @@ fi # Create-only: a repo may commit its own .gitignore here (e.g. to version # progress.md ledgers); overwriting it would revert that on every run. [ -e "$base/.gitignore" ] || printf '*\n' > "$base/.gitignore" -CDPATH='' cd -- "$dir" && pwd + +# On Windows (Git Bash, MSYS2, Cygwin) print C:/Users/... rather than +# /c/Users/... or /tmp/...: the caller may be PowerShell or another native +# tool, which can't resolve MSYS paths, and bash accepts this form too. +# Only the printed path changes; the plan-path markers above keep pwd -P's +# spelling, so existing workspaces still match their plans. +CDPATH='' cd -- "$dir" +if command -v cygpath >/dev/null 2>&1; then cygpath -m "$PWD"; else pwd; fi -- cgit