fix(app): treat localhost HTTP servers as non-local for desktop workspace picking#27673
Open
0xYiliu wants to merge 1 commit into
Open
fix(app): treat localhost HTTP servers as non-local for desktop workspace picking#276730xYiliu wants to merge 1 commit into
0xYiliu wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
- Change isLocal() to only recognize sidecar variant 'base' as local - Align getTerminalServerScope() with the same semantics - Extract isLocalConnection() pure function for testability - Add decision matrix tests for both predicates Fixes: connecting Desktop to WSL via localhost HTTP was incorrectly treated as local, causing Windows native Explorer to open instead of the in-app DialogSelectDirectory for browsing remote filesystem.
c49dc64 to
33a734e
Compare
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.
Issue for this PR
Closes #27674
Type of change
What does this PR do?
When Desktop connects to an opencode server running in WSL through localhost on port 4096, the app currently treats that connection as local and opens the native Windows directory picker for Add Workspace.
This change narrows that locality check so only the Desktop sidecar base connection is treated as local for filesystem integration. Manual HTTP connections, even on localhost, now go through the in-app directory picker instead.
I also aligned
getTerminalServerScope()with the same rule and added tests for the decision matrix.How did you verify your code works?
bun test src/context/server-islocal.test.ts src/context/terminal.test.tsbun typecheckgit pushran the repo's pre-push hook, which also ran the full typecheck successfullyScreenshots / recordings
Not included. This changes the connection-locality gate that chooses between the native picker and the in-app picker, but does not modify the UI itself.
Checklist