Skip to content

Gateway: on RunPod, job and output links use the pod's public URL - #26

Merged
neuregex merged 1 commit into
neuregex:mainfrom
ksylvan:runpod-public-gateway-links
Nov 30, 2026
Merged

neuregex merged 1 commit into
neuregex:mainfrom
ksylvan:runpod-public-gateway-links

Conversation

@ksylvan

@ksylvan ksylvan commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Problem

On a RunPod pod, a studio or npm run app outside the pod cannot get its results. The job runs and succeeds on the GPU, but the CLI stops with fetch failed.

RunPod's HTTP proxy sends the machine's own address as Host (for example 100.65.35.32:60021), not <pod>-8000.proxy.runpod.net. external_base() builds the job and output links from that Host, so the client gets links to a private address that it cannot open. The studio in the pod is not affected because it talks to the gateway on 127.0.0.1.

Seen on 28 Nov on an L40S pod from template p7g587ry3j: create-image succeeded, and its output url was https://100.65.35.32:60021/api/v2/assets/....

Change

  • infra/gateway.py: a new setting, FREEFIELD_PUBLIC_URL. When it is set and the request comes from a public host, links use that address. Requests from local and private addresses keep the address they used.
  • infra/pod.py: on RunPod, sets FREEFIELD_PUBLIC_URL to the gateway URL that where() already computes (https://<pod>-8000.proxy.runpod.net). A value set in the environment wins. On Vast.ai and on your own machine, where() gives no public gateway URL here, so nothing changes.
  • test/gateway_test.py: two new checks. A request with Host: 100.65.35.32:60021 gets the public URL, and a request on 127.0.0.1 keeps its own address.

Test

python test/gateway_test.py prints gateway relink ok. I did not test this on a pod, because the pod runs the published image.

🤖 Generated with Claude Code

RunPod's proxy sends the machine's own address as Host (100.65.x.x:600xx),
so a studio or CLI outside the pod got output links it could not open
("fetch failed"). pod.py now gives the gateway its public URL in
FREEFIELD_PUBLIC_URL, and the gateway uses it for requests from outside.
The studio in the pod keeps 127.0.0.1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T06:22:27.204663Z 652911c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ksylvan

ksylvan commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

@neuregex This is a small fix for your consideration.

@neuregex

Copy link
Copy Markdown
Owner

Thanks, @ksylvan! Clear write-up and a tight fix. One note for the record: on Vast.ai, where() does return a gateway URL (http://$PUBLIC_IPADDR:$VAST_TCP_PORT_8000), so links for a remote client change there too, from https://IP:port to http://IP:port. That looks like a fix as well, since those ports are plain HTTP. I checked both cases locally against the branch. Merging once CI is green.

@neuregex
neuregex merged commit b9540bc into neuregex:main Nov 30, 2026
4 checks passed
@ksylvan

ksylvan commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, @ksylvan! Clear write-up and a tight fix. One note for the record: on Vast.ai, where() does return a gateway URL (http://$PUBLIC_IPADDR:$VAST_TCP_PORT_8000), so links for a remote client change there too, from https://IP:port to http://IP:port. That looks like a fix as well, since those ports are plain HTTP. I checked both cases locally against the branch. Merging once CI is green.

Good point, and thanks for merging. I'm using freefield in my workflows now instead of Higgsfield.

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.

2 participants