fix(media): support configured image providers#1503
Closed
qdivan wants to merge 1 commit into
Closed
Conversation
Owner
|
skill 需同步改动 |
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.
What does this PR do?
Allows
/api/hermes/media/apikey-image-generateto use a requested configuredcustom_providersentry instead of only the hardcodedfun-codexprovider. The default remainsfun-codexfor backward compatibility, but callers can now sendprovider,provider_name, orcustom_providerto route image generation through another configured OpenAI-compatible image provider.Fixes #1483
Type of Change
Changes Made
packages/server/src/controllers/hermes/media.ts: resolves the requested API-key image provider fromcustom_providers, supportscustom:prefixes, and readsapi_key_env/key_envin addition to directapi_key.tests/server/media-controller.test.ts: adds a regression that routes image generation through a non-fun-codexprovider and verifies the/v1/images/generationsrequest.How to Test
PATH=/Users/shangyifan/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH npm exec vitest -- run tests/server/media-controller.test.tsgit diff --checkPATH=/Users/shangyifan/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH npm run harness:checkPATH=/Users/shangyifan/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH npm run test:coveragePATH=/Users/shangyifan/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH npm run buildChecklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
docs/, docstrings) — N/A, no public config shape changedcli-config.yaml.exampleif I added/changed config keys — N/A, existingcustom_providersfields are usedCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
No screenshot required; this is a local server media API routing fix covered by controller tests.
Duplicate search: checked active PRs for
fun-codex,apikey-image-generate,missing_fun_codex_provider,images/generations, and custom-provider image/video routing. Adjacent PRs #904, #950, #1261, #1071, #1314, and #1407 do not cover this endpoint.