Skip to content

fix: enable OpenCode provider detection on Windows#22

Open
tonyparkdev wants to merge 1 commit intokstost:mainfrom
tonyparkdev:fix/windows-opencode-detection
Open

fix: enable OpenCode provider detection on Windows#22
tonyparkdev wants to merge 1 commit intokstost:mainfrom
tonyparkdev:fix/windows-opencode-detection

Conversation

@tonyparkdev
Copy link
Copy Markdown

Summary

  • Fix check_opencode_available() in src/services/opencode.rs to work on Windows
  • Move COKAC_OPENCODE_PATH env var check before the #[cfg(windows)] block
  • Remove the blanket return false so where opencode fallback also executes

Problem

The #[cfg(windows)] { return false; } block at line 40-44 runs before:

  1. The COKAC_OPENCODE_PATH environment variable check (line 46)
  2. The where opencode command fallback (line 76-83)

This makes OpenCode always show ✗ on Windows regardless of installation or env var config.

Change

Reorder the function so COKAC_OPENCODE_PATH is checked first (cross-platform), then platform-specific detection (which on Unix, where on Windows).

Fixes #21

Move COKAC_OPENCODE_PATH env var check before the #[cfg(windows)]
early return, and remove the blanket `return false` so that the
`where opencode` fallback can also execute.

Previously, check_opencode_available() unconditionally returned false
on Windows before reaching the env var check or the `where` command,
making the OpenCode provider always show as unavailable.

Fixes kstost#21
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.

Bug: OpenCode provider always disabled on Windows

1 participant