Repository navigation
Store OpenCode 2 credentials on Windows and flag rejected keys - #1
Merged
tobiasritscher merged 2 commits intoOct 14, 2026
Conversation
…s on Linux The shim names its target with backslashes. path.join on POSIX keeps them inside one segment, so the test that runs the Windows lookup on Linux CI built a path that does not exist.
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
On Windows, setup could not store API keys for OpenCode 2, so profiles had no models in OpenCode Desktop 2.
opencode.exe: from PATH, behind the npm.cmdshim, or the CLI bundled with OpenCode Desktop. Node refuses JSON arguments to.cmdfiles (CVE-2024-27980).credential.removepassescredentialIDvia--param; replacing a key failed before.needs_authand clears the mark once discovery succeeds.declaredtests now pass on Windows.Evidence
[error] The argument 'args[5]' contains a cmd.exe special character ... "key":"sk-..."After: setup stores the key. Tested with OpenCode 2.0.29.
After: the connection shows
needs_auth; with a valid key it clears and 18 models appear.npm run check: 202 tests pass on Windows and in CI on Linux.Merge Danger
Door: two-way. No data or format migration; a revert restores the old behavior.
Blast Radius: setup and the OpenCode 2 plugin, in the CLI and Desktop alike. On Windows, setup resolves a different executable. On all platforms,
credential.removeuses--param, and a 401/403 marks the connectionneeds_auth. Executable lookup on macOS/Linux and OpenCode 1 are unchanged.