Skip to content

Reject loopback server-root-url on remote workers (REMOTE-2151)#107

Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
mainfrom
oz-agent/REMOTE-2151-localhost-notification-links
Draft

Reject loopback server-root-url on remote workers (REMOTE-2151)#107
warp-dev-github-integration[bot] wants to merge 1 commit into
mainfrom
oz-agent/REMOTE-2151-localhost-notification-links

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Summary

Warpy Factory Slack notifications (e.g. the "The agent sandbox expired before the task could complete" report in #feedback-platform) surfaced run/session links pointing at localhost instead 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-url and WARP_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 a localhost --server-root-url silently 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 guard validateServerURLs that fails fast when --web-socket-url targets a remote Warp server but --server-root-url resolves to a loopback host (localhost, 127.0.0.1/::1, or host.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 for validateServerURLs plus a mergeConfig integration test.
  • charts/oz-agent-worker/values.yaml: document that webSocketURL and serverRootURL must point at the same environment and that serverRootURL must be a public URL (never localhost) for deployed workers, with prod/staging examples.

Why this location

The warp-server link 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 staging warp-oz worker that runs Warpy) whose task-facing --server-root-url is 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.

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>
@warp-dev-github-integration warp-dev-github-integration Bot added the from-feedback-bot Linear issue delegated from Feedback Bot label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from-feedback-bot Linear issue delegated from Feedback Bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant