Skip to content

fix(samples): use configurable model name to resolve 404 errors in triaging agents#5697

Open
kedar49 wants to merge 1 commit into
google:mainfrom
kedar49:fix/triaging-agent-model-404
Open

fix(samples): use configurable model name to resolve 404 errors in triaging agents#5697
kedar49 wants to merge 1 commit into
google:mainfrom
kedar49:fix/triaging-agent-model-404

Conversation

@kedar49
Copy link
Copy Markdown

@kedar49 kedar49 commented May 13, 2026

Link to Issue or Description of Change

  1. Link to an existing issue (if applicable):
  1. Or, if no issue exists, describe the change:
    Problem:
    Several sample agents (adk_triaging_agent, adk_pr_triaging_agent, adk_answering_agent, and adk_issue_formatting_agent) had the model name gemini-2.5-pro hardcoded. When run via the Gemini Developer API (v1beta), this caused a 404 NOT_FOUND error as the model was not found or supported for generateContent in that specific environment.
    Solution:
    Removed the hardcoded model strings and introduced a configurable LLM_MODEL_NAME variable in the settings.py of each affected agent. The default value is set to gemini-2.5-flash, which is verified to work with the Gemini Developer API. This change allows users to easily override the model via environment variables without modifying the source code.
    Testing Plan
    Unit Tests:
  • All unit tests pass locally.
    pytest tests/unittests was executed and all tests passed.
    Manual End-to-End (E2E) Tests:
    To verify the fix:
  1. Navigate to any of the affected sample directories (e.g., contributing/samples/adk_triaging_agent).
  2. Ensure GOOGLE_API_KEY is set.
  3. Run the agent using adk run ..
  4. Verify that the agent initializes and makes LLM calls without throwing a 404 NOT_FOUND error.
  5. Optionally, set LLM_MODEL_NAME to another supported model in the environment to verify configurability.
    Checklist
  • I have read the CONTRIBUTING.md (https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works. (N/A - configuration change in samples)
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.
    Additional context
    This fix addresses a regression observed around 2026-05-08 where triaging workflows started failing consistently. Moving the model name to settings.py aligns these samples with other working agents in the repository (e.g., adk_issue_monitoring_agent).

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.

Triaging agent workflows fail with 404 on gemini-2.5-pro via Gemini Developer API

1 participant