Skip to content

Conversation

@rgodha24
Copy link
Contributor

When you run opencode web and try to access it over a tailscale network, for example, on a url like nixos:4096, we try to connect to the opencode client on localhost:4096 which isn't accessible.

This fixes that by defaulting to the current URL.

this fixes tailscaleusing opencode web with tailscale where you are, for
example, on a url like `nixos:4096`. on this website, we fail to contact
the backend, because the dev server is running on a different computer
(and therefore, we can not access the localhost of that computer)
Copilot AI review requested due to automatic review settings December 26, 2025 04:31
@rgodha24 rgodha24 changed the title fix: opencode web baseURL error fix: opencode web baseURL error Dec 26, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a connectivity issue when accessing the OpenCode web interface over a tailscale network or similar non-localhost addresses. The fix changes the fallback backend URL from a hardcoded localhost:4096 to use the current window origin.

  • Updates the backend URL resolution to use window.location.origin instead of hardcoded localhost

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrasbacsai
Copy link

This!

@adamdotdevin adamdotdevin merged commit 1bcf8d8 into sst:dev Dec 26, 2025
8 checks passed
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.

3 participants