fix(kun): route media generation through provider proxy for inline configs - #1269
Open
130rockirt wants to merge 1 commit into
Open
fix(kun): route media generation through provider proxy for inline configs#1269130rockirt wants to merge 1 commit into
130rockirt wants to merge 1 commit into
Conversation
…nfigs Image/speech/music/video tool configs without a providerId never resolve a provider credential, so createProxyFetch received an empty proxyUrl and the requests silently bypassed the configured model-request proxy. Fall back to the provider-level model proxy so custom inline media providers stay on the same proxied path as chat model requests. A resolved connection credential stays authoritative: when the connection explicitly bypasses the app proxy, its empty proxyUrl is honored instead of falling back, matching the chat model request routing.
130rockirt
force-pushed
the
codex/fix-media-gen-proxy
branch
from
September 3, 2026 17:45
9624713 to
6e27b7f
Compare
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
providerId) never resolve a provider credential, socreateProxyFetchreceived an emptyproxyUrland their requests silently bypassed the configured model-request proxy.generate_imagerequests time out or fail in networks that require the provider proxy, while chat model requests through the same provider work fine.Changes
kun/src/adapters/tool/image-gen-tool-provider.ts,media-gen-tool-provider.ts: accept a fallbackproxyUrloption. Inline configs without aproviderIdfall back to the provider-level model proxy so media requests stay on the same proxied path as chat model requests.proxyUrlis honored instead of falling back, matching the chat model request routing (runtime-factory-model.ts).kun/src/server/runtime-composition-services.ts,runtime-composition-config.ts: passmodelProxyUrlfrom the active serve options into the four media tool builders, on both initial composition and hot config apply.kun/src/adapters/tool/media-gen-proxy.test.ts: cover the inline-config proxy fallback (image + speech), credential-proxy precedence over the fallback, and the explicit-bypass case (no fallback when a resolved credential carries no proxy).Tests
npx vitest run src/adapters/tool/media-gen-proxy.test.ts— 9 passednpx vitest run src/adapters/tool/image-gen-network-error.test.ts— 6 passedtsc --noEmit— clean (rebased on latestdevelopincluding fix(kun): align proxied stream types #1270)eslinton all touched files — clean