mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #17] [MERGED] fix: resolve host-relative follow-up links against the origin, not base_url #25
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-python-sdk#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/17
Author: @sundar-svg
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/27/2026
Merged by: @wei-hai
Base:
main← Head:sundar/host-relative-follow-up-links📝 Commits (7)
255429cfix: resolve host-relative follow-up links against the origin, not base_url32be4fetrim url() comment to the load-bearing whyeb4628bdrop dated/hand-verification notes from test docstrings80c06a3make the gateway e2e workflow model-free (core nodes only)52391bdgateway e2e: allow overriding the test workflow via COMFY_WORKFLOW_FILE5c08487assert output dimensions, not compressed size368a360style: apply ruff format to gateway e2e test📊 Changes
3 files changed (+192 additions, -3 deletions)
View changed files
📝
src/comfy_low/transport.py(+7 -3)➕
tests/integration/test_gateway_e2e.py(+140 -0)➕
tests/test_follow_up_links.py(+45 -0)📄 Description
Description
First SDK↔gateway conformance bug, found (and now regression-locked) by running the SDK live against a staging serverless deployment.
The gateway serves the v2 contract under
/deployment/{id}/api/v2and returnsjob.urls.*follow-up links that are host-relative and already include that mount prefix — correct HTTP behavior._Prepared.url()only recognized links starting with/api/, so a gateway self link fell into the internal-shorthand branch and got built asbase_url + /api/v2 + link→ double prefix →NotFoundon the first poll after submit (Comfy(base_url).run(wf)submitted fine, then 404'd inJob.refresh()).Fix: a leading-slash path containing
/api/is a server-returned link and resolves against the origin (scheme+authority) — the link is authoritative about its own path. Internal shorthand paths (/jobs/…,/assets…) still resolve underbase_url + /api/v2, and Cloud / self-hosted construction is byte-identical to before (base_url == origin there). Auth attachment is unaffected (same origin).Also adds
tests/integration/test_gateway_e2e.py— an env-gated live e2e suite (skip unlessCOMFY_BASE_URL/COMFY_API_KEYare set) covering: multipart upload, blake3 dedup fast-path (HEAD by-hash→from-hash), img2img submit referencing the uploaded asset by name, adaptive poll to terminal, and output download via the content redirect. Thewf.set_input(node, field, asset)case isxfail: the gateway does not yet resolvecore/ASSETreferences (gap tracked on the cloud side).How tested
uv run pytest tests/— 97 passed (92 existing + 5 new URL-resolution regression tests)dep_9b63686e…(RTX 4090, SD1.5):2 passed, 1 xfailed in 23.60s— before the fix,test_image_edit_by_namefailed withNotFound: HTTP 404on refresh🤖 Generated with Claude Code
https://claude.ai/code/session_01KV7wUb2hyzKHsR52ZJTvAm
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.