Skip to content

Deployment Fixes: Cloud Build and Agent model names - #46

Open
AnkitGole007 wants to merge 6 commits into
benevolentbandwidth:mainfrom
AnkitGole007:main
Open

Deployment Fixes: Cloud Build and Agent model names#46
AnkitGole007 wants to merge 6 commits into
benevolentbandwidth:mainfrom
AnkitGole007:main

Conversation

@AnkitGole007

Copy link
Copy Markdown
Contributor

The previous build was failing before it even started. Installing pydantic-ai pulled 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 use gemini-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 /message endpoint. The service returned a 200 with a real response from the agent in 16 seconds.

POST /message → 200 OK · 16.12 s
{ "response": "Hello! Givelight is our programme designed to provide support
  to orphans and vulnerable children. We focus on ensuring they have access
  to education, healthcare, and a nurturing environment. How can I help you
  with Givelight today?" }

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-flash has been retired on Vertex AI in us-east1. Google returns "Publisher model not found" for any request that names a retired model, regardless of who is asking. gemini-2.5-flash works with the same credentials and returns a 200.

The whatsapp agent was already updated to gemini-2.5-flash in a previous PR. This build confirms the fix is live and working. The service is ready. The remaining step is for the webhook in benevolent-bandwidth to be pointed at the Cloud Run URL so live WhatsApp messages start flowing through.

eman-cickusic and others added 6 commits July 15, 2026 20:27
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
Copilot AI review requested due to automatic review settings July 21, 2026 20:12

Copilot AI 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.

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-ai with pydantic-ai-slim[google,vertexai] in the API requirements to avoid pulling unnecessary optional dependencies.
  • Update the configured Gemini model for whatsapp_agent, example_agent, and creative_agent to gemini-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:
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.

2 participants