Skip to content

fix(py): clearer errors when generate can't resolve a model - #5981

Closed
jeffdh5 wants to merge 1 commit into
genkit-ai:mainfrom
jeffdh5:fix/py-resolve-model-genkit-error
Closed

jeffdh5 wants to merge 1 commit into
genkit-ai:mainfrom
jeffdh5:fix/py-resolve-model-genkit-error

Conversation

@jeffdh5

@jeffdh5 jeffdh5 commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When generate has no model configured, callers get a clear invalid-argument error instead of a bare exception.
  • When a model name can't be resolved, the error says so explicitly and, if the name has no plugin prefix, hints that it should look like plugin/model.
  • Adds tests for both failure paths.

Extracted from #5854 so this UX fix can land on its own.

Test plan

  • Local preflight (--fix --fast): 1880 passed
  • CI on this PR

Surface INVALID_ARGUMENT / NOT_FOUND with a clearer missing-plugin-namespace hint instead of bare Exceptions.
@jeffdh5 jeffdh5 changed the title fix(py): raise GenkitError for generate model resolution failures fix(py): clearer errors when generate can't resolve a model Aug 7, 2026

@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 improves error handling during model resolution in Genkit by replacing generic exceptions with structured GenkitError instances. Specifically, it introduces INVALID_ARGUMENT and NOT_FOUND statuses, and adds a helpful hint to include the plugin namespace if a model name lacks a slash. Unit tests have also been added to verify these error scenarios. There are no review comments, and I have no feedback to provide.

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.

1 participant