Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Oct 9, 2025

Summary

Fixes #132 - Codex integration was not working on Windows during init and update commands.

Problem

The FILE_PATHS constant in codex.ts was using hardcoded forward slashes (/), which caused path.basename() to fail on Windows.

On Windows, path.basename() expects backslashes as path separators. When given a path with forward slashes like .codex/prompts/openspec-proposal.md, it would return the entire string instead of extracting just the filename openspec-proposal.md.

This broke:

  • Codex detection during openspec init (would show Codex as not configured even when it was)
  • Path construction in resolveAbsolutePath() which created incorrect file paths
  • File existence checks in isToolConfigured()

Solution

Changed FILE_PATHS to use path.join() which automatically uses the correct platform-specific path separators:

  • Windows: .codex\prompts\openspec-proposal.md (backslashes)
  • macOS/Linux: .codex/prompts/openspec-proposal.md (forward slashes)

Test plan

  • Test openspec init on Windows 11 and verify Codex is detected correctly
  • Test openspec update on Windows 11 and verify prompts are updated
  • Verify existing behavior on macOS/Linux remains unchanged
  • Verify paths are correctly resolved in C:\Users\<USERNAME>\.codex\prompts

🤖 Generated with Claude Code

Fixes #132

The FILE_PATHS constant was using hardcoded forward slashes, which caused
path.basename() to fail on Windows. On Windows, path.basename() expects
backslashes as path separators, so it would return the entire string
instead of just the filename.

This broke Codex detection on Windows during init/update because the
resolveAbsolutePath() method would construct incorrect paths, causing
file existence checks to fail.

Changed FILE_PATHS to use path.join() which automatically uses the
correct platform-specific path separators (backslashes on Windows,
forward slashes on Unix).
@TabishB TabishB merged commit a785c2a into main Oct 9, 2025
6 checks passed
drvova pushed a commit to drvova/VovaSpec that referenced this pull request Oct 13, 2025
…HS (Fission-AI#134)

Fixes Fission-AI#132

The FILE_PATHS constant was using hardcoded forward slashes, which caused
path.basename() to fail on Windows. On Windows, path.basename() expects
backslashes as path separators, so it would return the entire string
instead of just the filename.

This broke Codex detection on Windows during init/update because the
resolveAbsolutePath() method would construct incorrect paths, causing
file existence checks to fail.

Changed FILE_PATHS to use path.join() which automatically uses the
correct platform-specific path separators (backslashes on Windows,
forward slashes on Unix).
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.

Codex native support not working in Windows.

2 participants