Repository navigation
fix(client): rewrite wildcard service URLs to loopback - #49805
cestercian wants to merge 1 commit into
Conversation
Probe and connect through 127.0.0.1/::1 when the registration advertises 0.0.0.0 or :: so HTTP proxies cannot intercept local CLI clients.
|
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. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes #49796
Type of change
What does this PR do?
When the service registers as
http://0.0.0.0:<port>(or IPv6::), CLI clients probed that URL verbatim. With an HTTP proxy set and the wildcard not inno_proxy, the proxy answered 502 and the service looked unhealthy.This change adds shared
loopbackURL()and uses it for Effect/Promise probes,baseUrl, PTY handoff, and desktop connect so local clients hit127.0.0.1/::1. Registration can still advertise the wildcard for LAN/opencode pair.How did you verify your code works?
From
packages/client:bun test test/service-url.test.ts test/service.test.ts test/promise-service.test.ts— 31 passbun typecheck(client/desktop/cli); pre-push turbo typecheck passedScreenshots / recordings
N/A — client URL rewrite covered by unit tests.
Checklist