Skip to content

[codex] Fix Windows workspace path CI failure#1111

Merged
alfred-openspec merged 5 commits into
mainfrom
codex/fix-main-windows-ci-paths
May 23, 2026
Merged

[codex] Fix Windows workspace path CI failure#1111
alfred-openspec merged 5 commits into
mainfrom
codex/fix-main-windows-ci-paths

Conversation

@TabishB
Copy link
Copy Markdown
Contributor

@TabishB TabishB commented May 21, 2026

Summary

Fix the Windows-only main CI failure in the CI workflow by keeping workspace planning-home path comparisons in canonical path space.

Root cause

The failing main run was CI run 26182487591 on commit 79303b5. Linux, macOS, lint, CodeQL, and release-prepare passed; the Windows PowerShell test leg failed.

The Windows runner exposed the same workspace directory with two spellings: a short path under C:\Users\RUNNER~1\... and the canonical long path under C:\Users\runneradmin\.... findWorkspacePlanningRootSync() returned a canonical workspace root, but resolveCurrentPlanningHomeSync() compared it against the non-canonical search start. That made workspace-scoped new change --areas ... invocations fall back to repo planning mode and exit non-zero. A related config-profile assertion saw workspace update invoked from the canonical root instead of the current cwd spelling.

Changes

  • Canonicalize the planning-home search start after resolving an existing start directory.
  • Preserve the user/current cwd when applying config profile changes via openspec workspace update.
  • Add a symlink-alias regression test that reproduces the same canonical-vs-alias comparison class outside Windows.
  • Add a patch changeset.

Validation

  • pnpm exec vitest run test/core/planning-home.test.ts test/commands/config-profile.test.ts test/commands/artifact-workflow.test.ts
  • pnpm run build
  • pnpm exec tsc --noEmit
  • pnpm lint
  • pnpm test
  • pnpm exec changeset status --since=origin/main

Summary by CodeRabbit

  • Bug Fixes

    • Fixed workspace planning detection when the workspace root is accessed via Windows short paths or symlink/junction aliases.
  • Documentation

    • Added test runner guidance and filesystem path canonicalization practices to prevent CI failures from path inconsistencies across platforms.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c21cc834-1d04-4056-8969-dc995ed5957c

📥 Commits

Reviewing files that changed from the base of the PR and between 79303b5 and 63c15fa.

📒 Files selected for processing (5)
  • .changeset/canonical-workspace-paths.md
  • src/commands/config.ts
  • src/core/planning-home.ts
  • test/AGENTS.md
  • test/core/planning-home.test.ts

📝 Walkthrough

Walkthrough

This PR fixes workspace planning detection to preserve the workspace kind when Windows short paths or symlink aliases resolve to a canonical workspace root, ensuring path spelling differences across platforms and symlinked environments do not break workspace detection.

Changes

Workspace planning detection with canonical paths

Layer / File(s) Summary
Path canonicalization in planning home resolution
src/core/planning-home.ts
getSearchStartDirectory canonicalizes the computed search start path via FileSystemUtils.canonicalizeExistingPath to normalize symlinks and Windows path variations.
Preserve caller working directory in config commands
src/commands/config.ts
WorkspaceConfigProfileContext adds commandCwd field to record the caller's working directory and passes it to workspace update subprocesses, preserving invocation context.
Symlink canonicalization test and test guidance
test/core/planning-home.test.ts, test/AGENTS.md, .changeset/canonical-workspace-paths.md
New filesystem-based test validates planning home resolution through symlink/junction paths; test setup includes temp directory cleanup; guidance documents canonicalization practices for cross-platform test stability.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#972: Refines FileSystemUtils.canonicalizeExistingPath to prefer native realpath with matching regression tests, complementing the main PR's use of canonicalization.
  • Fission-AI/OpenSpec#1055: Updates Windows path handling expectations in workspace-related tests to match canonical path behavior.
  • Fission-AI/OpenSpec#1057: Adjusts workspace open/Codex/VS Code argument assertions to use canonicalized paths in coordination with planning-home resolution changes.

Suggested reviewers

  • alfred-openspec

Poem

🐰 Hops through the symlink paths so fine,
Canonical roots now perfectly align,
Windows shortcuts and junctions all blessed,
Workspace detection passes the test! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[codex] Fix Windows workspace path CI failure' directly relates to the main change: fixing path canonicalization issues that caused CI failures on Windows by handling workspace planning-home path comparisons correctly.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-main-windows-ci-paths

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TabishB TabishB marked this pull request as ready for review May 23, 2026 01:35
Copy link
Copy Markdown
Collaborator

@alfred-openspec alfred-openspec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The fix keeps workspace planning comparisons in canonical path space while preserving the invocation cwd for workspace update, and the symlink-alias regression covers the Windows short/long path class. CI is green.

@alfred-openspec alfred-openspec added this pull request to the merge queue May 23, 2026
Merged via the queue into main with commit 7fdb177 May 23, 2026
12 checks passed
@alfred-openspec alfred-openspec deleted the codex/fix-main-windows-ci-paths branch May 23, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants