Skip to content

label Agy's model field for the agent it selects, and allow a per-render override - #3203

Merged
atomantic merged 1 commit into
mainfrom
cos/task-ms5lo95z/agent-85766489
Jul 29, 2026
Merged

label Agy's model field for the agent it selects, and allow a per-render override#3203
atomantic merged 1 commit into
mainfrom
cos/task-ms5lo95z/agent-85766489

Conversation

@atomantic

Copy link
Copy Markdown
Owner

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 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. Verified against the shipped binary: GenerateImageToolConfig carries only force_disable and output_directory, and the tool args are prompt / image name / aspect ratio / reference paths. There is no imagen-3 / imagen-3-fast option to offer, and handing --model an id outside the agy models catalog 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:

  • New 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 image backend, no model knob), so an override there is ignored rather than silently changing nothing at spawn time. Mirrored client-side as supportsCloudModelOverride so the two stay in lock-step.
  • The Image Gen page renders an Agent model picker driven by the live probe, so a single queue item can run on a different agent model than the saved default without a settings round-trip. Blank inherits the Settings default (and the option names what that resolves to). A pin the catalog no longer lists falls back to the default instead of failing the render — derived, not written back to state, so a transient probe failure doesn't destroy the selection.
  • The probe is opt-in via an enabled flag on the new useAgyModels hook, 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 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: ''.

Test plan

  • cd client && npm run lint — clean
  • cd client && npx vitest run478 files / 5349 tests pass
  • cd server && npx vitest run routes/imageGen.test.js services/imageGen/ lib/antigravity lib/providerModels lib/index.test.js15 files / 392 tests pass

New coverage:

  • server/routes/imageGen.test.jscloudModel overrides 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 no model to jobParams.
  • 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-array models degrades to [], refresh() re-probes.
  • client/src/components/media/MediaJobsQueue.test.jsx — an Agy retry pre-fills from params.model and 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_test isn't provisioned here, and they fail identically on a clean main checkout. None of them touch image gen.

…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: ''`.
@atomantic
atomantic merged commit 6c5eb1f into main Jul 29, 2026
6 checks passed
@atomantic
atomantic deleted the cos/task-ms5lo95z/agent-85766489 branch July 29, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant