Skip to content

fix(js): add longRunning back to ModelInfo supports - #7442

Open
ifielker wants to merge 1 commit into
v2from
if-V2FixLongrunning
Open

ifielker wants to merge 1 commit into
v2from
if-V2FixLongrunning

Conversation

@ifielker

@ifielker ifielker commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

fix(js): add longRunning back to ModelInfo supports

Why

generateOperation only accepts models whose supports.longRunning is
true, but the JS ModelInfoSchema no longer declares that field (it was
dropped in #3070). The shared schema still has it (genkit-tools
ModelInfoSchema, genkit-schema.json, Go's ModelSupports.LongRunning),
so JS was the only place where it was missing.

Without it in the type, a plugin can't write longRunning: true in a
ModelInfo literal. The google-genai plugin worked around this by
declaring the supports objects of Deep Research and Veo as separate
consts, so TypeScript's excess-property check didn't apply. That hides the
field from the type checker the same way a cast would (raised in the
review of #7341).

What changed

  • js/ai: ModelInfoSchema.supports has longRunning: z.boolean().optional() again, with the same doc comment as genkit-tools.
  • google-genai: the supports objects of googleAI Deep Research (both
    model groups), vertexAI Deep Research and Veo are written inline in their
    ModelInfo again; the workaround comments are gone.

Runtime behaviour is unchanged: the model metadata is the same objects as
before.

Testing

  • js/ai: build and unit tests pass, including new generateOperation
    tests (a background model with longRunning: true returns its
    operation; one without it is rejected with INVALID_ARGUMENT).
  • google-genai: build, unit tests (1222) and the testapp type check pass.
    Tests check supports.longRunning directly on googleAI Deep Research
    (known and generic models), vertexAI Deep Research and Veo.
  • Live, basic-gemini testapp, Gemini Enterprise Agent Platform: a Deep
    Research request completed with its report, and a Veo text-to-video
    request returned an 8-second 720p video. On the Gemini API, Deep
    Research tasks started and were polled normally, but the server ended
    them with ABORTED ("There was a problem processing your request")
    in both runs; that error is reported by the task itself, after the
    plugin's requests were accepted.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the longRunning property to the ModelInfoSchema supports definition, allowing models to explicitly declare support for long-running operations. Consequently, workaround type definitions and assertions in Google GenAI and Vertex AI plugins (such as Deep Research and Veo) have been cleaned up and simplified to directly use the new property. Corresponding unit tests have also been added and updated to verify this functionality. I have no further feedback to provide as there are no review comments.

@github-actions github-actions Bot added the js label Dec 2, 2026

@genkit-bot genkit-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Details

Run 11c87e2b-28fb-478c-b80d-ba8b595629a4 · Cloud Run logs · Dashboard

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants