fix(kun): route media generation through provider proxy for inline configs - #1269
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.
9624713 to
6e27b7f
Compare
|
Windows CI note: This test file is untouched by this PR (the diff is limited to Quality gates (typecheck, lint, unit tests) pass. A rerun should clear the failing badge. |
XingYu-Zhong
left a comment
There was a problem hiding this comment.
Reviewed against latest develop. Media proxy behavior and precedence are correct; relevant media tests pass. Windows failures are unrelated updater-test flakes.
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