fix: Windows compatibility for qodercli#1
Open
shadowericq wants to merge 1 commit intozxcrf:mainfrom
Open
Conversation
…nsupported flags - Fix resolveQoderCLI() to search for .exe/.cmd on Windows and check npm global package embedded binary path - Add wrapStringAsStream() to force streaming input mode (--input-format stream-json) instead of --print, avoiding Windows ENAMETOOLONG - Remove unsupported CLI flags from buildCommand(): --verbose, --storage-dir, --resource-dir, --max-turns, --max-budget-usd, --fallback-model, --betas, --resume-session-at, --include-partial-messages, --max-thinking-tokens, --json-schema - Add --mcp-config temp file fallback when JSON exceeds 8000 chars (Windows command line length limit)
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
This PR fixes the opencode-qoder-auth plugin to work on Windows with qodercli installed via npm.
Root Cause Chain (4 sequential failures)
resolveQoderCLI()only searched for bareqodercli— on Windows, the binary isqodercli.exe--printmode causedENAMETOOLONGon Windows (command line limit ~32767 chars)--verboseflag not supported by qodercli → exit code 1--storage-dir,--resource-dir, etc.) not supported by qodercli → silent failuresChanges
src/qoder-language-model.tsresolveQoderCLI(): On Windows, search forqodercli.exefirst, then.cmd, then bare name. Also check npm global package embedded binary path (%APPDATA%\npm\node_modules\@qoder-ai\qodercli\bin\qodercli.exe)wrapStringAsStream(): Forces streaming input mode (--input-format stream-json) instead of--print, avoiding Windows ENAMETOOLONG for long promptsdoStream(): String prompts are wrapped as async iterables so SDK uses stdin-based inputsrc/vendor/qoder-agent-sdk.mjs--verbosefrombuildCommand()— not supported by qodercli--storage-dir,--resource-dir,--max-turns,--max-budget-usd,--fallback-model,--betas,--resume-session-at,--include-partial-messages,--max-thinking-tokens,--json-schema--mcp-configtemp file fallback: When MCP config JSON exceeds 8000 chars, write to temp file instead of passing inline (avoids ENAMETOOLONG on Windows)Testing
qodercli.exeon Windows--input-format stream-json) works from Node.js spawnresult successwith exit code 0ProviderInitErrorin opencodeKnown Limitations
stream_eventmessages — only completeassistantmessages. This means no token-by-token streaming; the full response appears at once. This is a CLI limitation, not a plugin issue.