Skip to content

fix(cli): resolve symlink paths in workspace checks and create output - #32

Merged
caorushizi merged 1 commit into
masterfrom
codex/fix-macos-symlink-paths
Sep 14, 2026
Merged

caorushizi merged 1 commit into
masterfrom
codex/fix-macos-symlink-paths

Conversation

@caorushizi

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings September 14, 2026 16:23
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
one-cli-docs Ready Ready Preview Sep 14, 2026 4:23pm UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Canonicalized relative paths can be incorrect from a symlinked logical working directory.

Pull request overview

Updates CLI create-path output and Go workspace validation to handle symlinked paths consistently.

Changes:

  • Resolve symlink-aware paths for create output.
  • Compare workspace files by filesystem identity.
  • Add regression coverage for symlink scenarios.
File summaries
File Summary
packages/cli/internal/transport/cobra/create/result.go Symlink-aware create-path resolution.
packages/cli/internal/transport/cobra/create/result_test.go Tests symlink-aware relative paths.
packages/cli/internal/modules/dependencies/service.go Symlink-equivalent workspace checks.
packages/cli/internal/modules/dependencies/service_test.go Tests accepted and rejected workspace paths.
Review details

Suppressed comments (1)

packages/cli/internal/transport/cobra/create/result.go:80

  • Canonicalizing both paths before computing a relative cd path can produce a path that is wrong from the user's logical working directory. For example, with cwd /tmp/long/link/sub (link -> /tmp/root) and target /tmp/other, this returns ../../other, which a shell started in the logical cwd resolves as /tmp/long/other, not /tmp/other. Validate the computed relative path against the original cwd and fall back to the original filepath.Rel(cwd, targetDir) (or emit an absolute canonical target) when it is not valid.
	rel, err := filepath.Rel(resolveDisplayPath(cwd), resolveDisplayPath(targetDir))
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@caorushizi
caorushizi merged commit 662e7a4 into master Sep 14, 2026
7 of 8 checks passed
@caorushizi
caorushizi deleted the codex/fix-macos-symlink-paths branch September 14, 2026 16:28
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