label Agy's model field for the agent it selects, and allow a per-render override - #3203
Merged
Merged
Conversation
…der override The Image Gen settings field was labeled "Image model" while listing Gemini agent models, which read as the wrong catalog being loaded. It isn't: `agy models` enumerates the *agent* models the CLI's `--model` flag accepts, and that agent is what drives the built-in `generate_image` tool. Agy exposes no knob for the underlying image model — its `GenerateImageToolConfig` carries only `force_disable` and `output_directory`, and the tool args are prompt / image name / aspect ratio / reference paths — so there is no imagen-* option to offer, and passing one makes agy exit non-zero before it generates. The field is now "Default agent model" with that explanation instead of a label that promises a knob the CLI doesn't have. Adds the override half: a `cloudModel` request field, folded into the provider's own `model` by resolveCloudProviderConfig and stripped before it reaches persisted job params. Gated per provider by a `supportsModelOverride` spec flag (grok is false — fixed xAI backend, no model knob) with a mirrored `supportsCloudModelOverride` on the client. The Image Gen page renders an "Agent model" picker driven by the live probe; blank inherits the Settings default, and a pin the catalog no longer lists falls back to the default rather than failing the render. Also fixes the retry editor on a failed Agy job: it was bound to `params.modelId` (a local image-model registry id Agy never reads), so the model was uneditable. It now follows `params.model` for every backend that takes a CLI model, and renders a configured-default sentinel as an empty field so an untouched form doesn't submit `model: ''`.
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
The Image Gen settings field for the Agy (Antigravity) backend was labeled "Image model" while listing Gemini agent models (
gemini-3.6-flash-high,gemini-3.1-pro-high, …), which reads as the wrong catalog being loaded.It isn't the wrong catalog — the label was wrong.
agy modelsenumerates the agent models the CLI's--modelflag accepts, and that agent is what drives the built-ingenerate_imagetool.Agy exposes no knob for the underlying image model. Verified against the shipped binary:
GenerateImageToolConfigcarries onlyforce_disableandoutput_directory, and the tool args are prompt / image name / aspect ratio / reference paths. There is noimagen-3/imagen-3-fastoption to offer, and handing--modelan id outside theagy modelscatalog makes agy exit non-zero before it generates. So the field is now "Default agent model" with that explanation, rather than a label promising a knob the CLI doesn't have.The override half of the request is delivered in full:
cloudModelrequest field, folded into the provider's ownmodelbyresolveCloudProviderConfigand stripped before it reaches persisted job params.supportsModelOverridespec flag — grok isfalse(fixed xAI image backend, no model knob), so an override there is ignored rather than silently changing nothing at spawn time. Mirrored client-side assupportsCloudModelOverrideso the two stay in lock-step.enabledflag on the newuseAgyModelshook, so a backend the user hasn't selected never spawns a child process.Also fixes a latent bug found along the way: the retry editor on a failed Agy job was bound to
params.modelId(a local image-model registry id Agy never reads), so the model was effectively uneditable on retry. It now followsparams.modelfor every backend that takes a CLI model, and renders a configured-default sentinel as an empty field so an untouched form doesn't submitmodel: ''.Test plan
cd client && npm run lint— cleancd client && npx vitest run— 478 files / 5349 tests passcd server && npx vitest run routes/imageGen.test.js services/imageGen/ lib/antigravity lib/providerModels lib/index.test.js— 15 files / 392 tests passNew coverage:
server/routes/imageGen.test.js—cloudModeloverrides the saved model for codex and agy, does not leak the raw field into persisted job params, an omitted value leaves the saved default in place, and a shell-unsafe id is rejected by Zod before settings are ever read.server/services/imageGen/cloudProviderConfig.test.js— override wins over the saved default; blank/whitespace/non-string means "inherit"; an override for grok is ignored and adds nomodeltojobParams.client/src/components/imageGen/ImageGenControls.test.jsx— the picker is hidden when the probe returned nothing or the host wired no handler, lists every probed model plus a named "Settings default (…)" option, and emits blank when cleared.client/src/hooks/useAgyModels.test.jsx— no probe while disabled, silent request, in-body error vs rejected request both surface, non-arraymodelsdegrades to[],refresh()re-probes.client/src/components/media/MediaJobsQueue.test.jsx— an Agy retry pre-fills fromparams.modeland submits the edit; a configured-default sentinel shows as empty and sends no override.The 53 failing server suites on this machine (pipeline / universeBuilder / writersRoom / catalog / sharing) are pre-existing —
portos_testisn't provisioned here, and they fail identically on a cleanmaincheckout. None of them touch image gen.