fix bug where projects with "localhost" in the URL are misrouted#882
Merged
andrewnitu merged 2 commits intomainfrom Apr 10, 2026
Merged
fix bug where projects with "localhost" in the URL are misrouted#882andrewnitu merged 2 commits intomainfrom
andrewnitu merged 2 commits intomainfrom
Conversation
real-danm
reviewed
Apr 8, 2026
| } | ||
|
|
||
| func isLocalURL(rawURL string) bool { | ||
| u, err := url.Parse(rawURL) |
Contributor
There was a problem hiding this comment.
can you add some tests for this? make sure we can support the project names with 'localhost' and a few other formats?
yoonsio
reviewed
Apr 8, 2026
Contributor
yoonsio
left a comment
There was a problem hiding this comment.
Would appreciate it if you could provide some context.
Do we have support for localhost projects?
Contributor
Author
|
@yoonsio a customer has a project name with "localhost" in it and the builds totally fail for them. see https://live-kit.slack.com/archives/C08HHUXHAKA/p1775494175027349 for details tbh i don't know why this localhost thing is here, my guess is if you're testing multiple services on your laptop? Trying to not regress that workflow. |
real-danm
approved these changes
Apr 10, 2026
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.
The localhost check in getAgentsURL (line 157) uses strings.Contains to detect local development URLs, but this also matches project subdomains that happen to contain "localhost" as a substring (e.g. air-localhost-ist1jyfs).
When this happens, the regex replacement that rewrites the project subdomain to agents.livekit.cloud is skipped entirely. Requests to /build and other agent endpoints end up hitting the *.livekit.cloud wildcard ingress on the core cluster instead of the agents service, and the cloud-controller catch-all returns "OK" — which fails to decode as a valid response.