Deployment Fixes: Cloud Build and Agent model names - #46
Open
AnkitGole007 wants to merge 6 commits into
Open
Conversation
The /message endpoint runs whatsapp_agent, pinned to gemini-2.0-flash. That model is decommissioned on Vertex AI and now returns 404 NOT_FOUND "Publisher model ... was not found or your project does not have access to it" for every call (reproduced in us-east1 against both benevolent-bandwidth and b2-platform). It is not an IAM issue -- a missing role returns 403, and gemini-2.5-flash returns 200 with the same credentials. Switch to gemini-2.5-flash (GA, verified 200 in us-east1, already used by poc_deathCertParserAgent; works with thinking_budget: 0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…odel Fix /message 404: whatsapp_agent uses retired gemini-2.0-flash
- pydantic-ai -> pydantic-ai-slim[google,vertexai] to avoid logfire transitive conflict that broke Cloud Build - GoogleProvider(vertexai=True) -> GoogleCloudProvider to clear deprecation warning in Cloud Run logs
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes deployment failures and runtime 404s by (1) tightening the API image dependency set to avoid installing unused pydantic-ai extras that were causing pip resolution conflicts, and (2) updating agent YAML configurations to use an existing Vertex AI Gemini model name.
Changes:
- Replace
pydantic-aiwithpydantic-ai-slim[google,vertexai]in the API requirements to avoid pulling unnecessary optional dependencies. - Update the configured Gemini model for
whatsapp_agent,example_agent, andcreative_agenttogemini-2.5-flash.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| requirements-api.txt | Switches to pydantic-ai-slim with only Google/Vertex AI extras to prevent dependency-resolution failures during build. |
| agents/whatsapp_agent.yaml | Updates the WhatsApp agent model to gemini-2.5-flash. |
| agents/exampleAgent.yaml | Updates the example agent model to gemini-2.5-flash. |
| agents/creativeAgent.yaml | Updates the creative writing agent model to gemini-2.5-flash. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
26
to
28
| type: gemini | ||
| model: gemini-2.0-flash | ||
| model: gemini-2.5-flash | ||
| settings: |
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.
The previous build was failing before it even started. Installing
pydantic-aipulled in every optional add-on the package offers, none of which we use. One of those add-ons, the logging library, had a version conflict that made pip give up entirely and refuse to build the image.This PR swaps the full package for a slimmer version that only includes the two things we need: Google model support and Vertex AI. The build now completes cleanly.
Agent model names
Two background agents: an example agent and a creative writing agent, were configured to use a model called
gemini-3.1-flash-lite-preview. That model does not exist. If the message router ever sent a conversation to either of those agents, the request would fail with a 404. Both have been updated to usegemini-2.5-flash, the same model the WhatsApp agent uses.Confirmed working end to end
After these fixes were deployed, a test message: "Hello B2, what is Givelight?" was sent through Postman directly to the
/messageendpoint. The service returned a 200 with a real response from the agent in 16 seconds.What was actually causing the 404
An earlier theory pointed to an IAM permission as the blocker. Eman dug into it and confirmed that was not the case, a missing permission would return a 403, not a 404. The real issue was that
gemini-2.0-flashhas been retired on Vertex AI inus-east1. Google returns "Publisher model not found" for any request that names a retired model, regardless of who is asking.gemini-2.5-flashworks with the same credentials and returns a 200.The whatsapp agent was already updated to
gemini-2.5-flashin a previous PR. This build confirms the fix is live and working. The service is ready. The remaining step is for the webhook inbenevolent-bandwidthto be pointed at the Cloud Run URL so live WhatsApp messages start flowing through.