fix: enable OpenCode provider detection on Windows#22
Open
tonyparkdev wants to merge 1 commit intokstost:mainfrom
Open
fix: enable OpenCode provider detection on Windows#22tonyparkdev wants to merge 1 commit intokstost:mainfrom
tonyparkdev wants to merge 1 commit intokstost:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
check_opencode_available()insrc/services/opencode.rsto work on WindowsCOKAC_OPENCODE_PATHenv var check before the#[cfg(windows)]blockreturn falsesowhere opencodefallback also executesProblem
The
#[cfg(windows)] { return false; }block at line 40-44 runs before:COKAC_OPENCODE_PATHenvironment variable check (line 46)where opencodecommand 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_PATHis checked first (cross-platform), then platform-specific detection (whichon Unix,whereon Windows).Fixes #21