fix(image-gen): honor top-level image_gen.model and dispatch model kwarg in the xAI provider - #37
Open
hashbender wants to merge 1 commit into
Open
fix(image-gen): honor top-level image_gen.model and dispatch model kwarg in the xAI provider#37hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
…arg in the xAI provider
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?
Fixes a parity gap in image-gen model resolution.
hermes toolspersists theselected image model to the top-level
image_gen.model, and theimage_generatedispatcher forwards it toprovider.generate()as amodelkwarg. The xAI provider read only the scoped
image_gen.xai.model(plusthe
XAI_IMAGE_MODELenv var) and called_resolve_model()with no arguments— so a user's
hermes toolsselection was silently dropped and xAI always fellback to its default
grok-imagine-image.This is the same gap recently fixed for the OpenRouter/Nous provider; openai,
openai-codex and krea already honor the top-level
image_gen.model, so xAI wasthe lone holdout. This brings xAI in line with the rest.
Related Issue
N/A
Type of Change
Changes Made
plugins/image_gen/xai/__init__.py_load_image_gen_config()— reads the top-levelimage_gensection._resolve_model(explicit=None)now follows the same precedence as theother providers: explicit dispatch
modelkwarg →XAI_IMAGE_MODELenv →scoped
image_gen.xai.model→ top-levelimage_gen.model→DEFAULT_MODEL.generate()forwards the dispatched kwarg:_resolve_model(kwargs.get("model"))._load_xai_configand_resolve_resolutionare left untouched.tests/plugins/image_gen/test_xai_provider.py— add scoped / top-level /explicit-kwarg model-resolution coverage.
How to Test
Reproduction: set the image model in the top-level
image_gen.model(whathermes toolswrites) without a scopedimage_gen.xai.model, then resolve thexAI model.
plugins.image_gen.xai._resolve_model()returnsgrok-imagine-image(the default) — the selection is ignored.
explicit dispatched
modelkwarg wins over config.Tests run and results:
The change is isolated to xAI model resolution; verified against an unmodified
baseline that it introduces no new failures in the full
tests/plugins/image_gen/suite (it adds the 3 passing tests above).Checklist
fix(image-gen): …)image_gen.modelis already documented and honored by the other providers)Mirror-of: NousResearch#55927
NousResearch#55927