Reject loopback server-root-url on remote workers (REMOTE-2151)#107
Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
Draft
Reject loopback server-root-url on remote workers (REMOTE-2151)#107warp-dev-github-integration[bot] wants to merge 1 commit into
warp-dev-github-integration[bot] wants to merge 1 commit into
Conversation
Warpy Factory Slack notifications surfaced run/session links pointing at localhost instead of the environment's public URL. The task-facing server root URL is passed to the oz CLI (via --server-root-url / WARP_SERVER_ROOT_URL) and used to build the run and session links shown in outbound notifications. A deployed worker connecting to a remote Warp server while advertising a loopback server-root-url silently emits localhost links that are unreachable for anyone reading the notification. Add a startup guard (validateServerURLs) that fails fast when --web-socket-url targets a remote server but --server-root-url is a loopback host (localhost, 127.0.0.1/::1, or host.docker.internal). All-local setups (script/oz-local, where both URLs are loopback) remain valid. Also document the per-environment requirement in the Helm chart values. Co-Authored-By: Oz <oz-agent@warp.dev>
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
Warpy FactorySlack notifications (e.g. the "The agent sandbox expired before the task could complete" report in #feedback-platform) surfaced run/session links pointing atlocalhostinstead of the environment's public URL (staging.warp.dev/warp.dev).The task-facing server root URL is passed by the worker to the oz CLI (via
--server-root-urlandWARP_SERVER_ROOT_URL) and is used to build the run and session links shown in outbound notifications (Slack, GitHub, Linear, etc.). A deployed worker that connects to a remote Warp server while advertising alocalhost--server-root-urlsilently emits localhost links that are unreachable for anyone reading the notification.This is the incorrect-localhost-URL half of the report; the sandbox-expiry handling itself is tracked separately in REMOTE-2056.
Changes
main.go: add a startup guardvalidateServerURLsthat fails fast when--web-socket-urltargets a remote Warp server but--server-root-urlresolves to a loopback host (localhost,127.0.0.1/::1, orhost.docker.internal). Fully-local setups (e.g.script/oz-local, where both URLs are loopback) remain valid, so local development is unaffected.main_test.go: table-driven tests forvalidateServerURLsplus amergeConfigintegration test.charts/oz-agent-worker/values.yaml: document thatwebSocketURLandserverRootURLmust point at the same environment and thatserverRootURLmust be a public URL (never localhost) for deployed workers, with prod/staging examples.Why this location
The
warp-serverlink builders correctly use configured origins, which resolve to the right public URLs in staging/prod. The remaining way localhost links reach a real notification is a self-hosted worker (like the stagingwarp-ozworker that runs Warpy) whose task-facing--server-root-urlis misconfigured. Its Helm values are installed manually (Terraform only provisions the namespace), so this change makes the misconfiguration fail loudly at startup and documents the correct values.Testing
go build ./...go vet ./...go test ./...(new tests pass)Conversation: https://staging.warp.dev/conversation/a5952eaf-39d2-40fd-9e8c-641b1cb37ff6
Run: https://oz.staging.warp.dev/runs/019f612c-9363-7672-bafd-ad3a1a6a8a22
This PR was generated with Oz.