Skip to content

fix: pin google-genai < 2.0.0 in Gemini agent templates#1433

Merged
jariy17 merged 1 commit into
aws:mainfrom
notgitika:fix/pin-gemini-deps
Jun 1, 2026
Merged

fix: pin google-genai < 2.0.0 in Gemini agent templates#1433
jariy17 merged 1 commit into
aws:mainfrom
notgitika:fix/pin-gemini-deps

Conversation

@notgitika
Copy link
Copy Markdown
Contributor

Summary

  • Pin google-genai >= 1.0.0, < 2.0.0 across all GoogleADK and LangGraph Gemini templates to prevent incompatible major version resolution
  • Fixes e2e test failures (langgraph-gemini and googleadk-gemini) that started on June 1 due to transitive dependency resolution pulling google-genai 2.x

Root Cause

google-genai 2.0.0+ introduced breaking API changes:

  • vertexai parameter renamed to enterprise in Client instantiation
  • New Interactions API structure with renamed SSE events
  • langchain-google-genai 4.2.4 (released May 28) started allowing google-genai 2.x, so fresh installs resolve to 2.7.0

The templates had no upper bound on google-genai, either directly (in GoogleADK templates) or transitively (via langchain-google-genai in LangGraph templates).

Changes

Template Fix
python/http/googleadk Added explicit google-genai >= 1.0.0, < 2.0.0
python/a2a/googleadk Tightened existing google-genai >= 1.0.0< 2.0.0
python/agui/googleadk Tightened existing google-genai >= 1.0.0< 2.0.0
python/http/langchain_langgraph (Gemini block) Added explicit google-genai >= 1.0.0, < 2.0.0
python/a2a/langchain_langgraph (Gemini block) Added explicit google-genai >= 1.0.0, < 2.0.0
python/agui/langchain_langgraph (Gemini block) Added explicit google-genai >= 1.0.0, < 2.0.0

Test plan

  • npm run build passes
  • Asset snapshot tests updated and passing (124 tests)
  • Pre-commit hooks (typecheck, lint, secretlint) pass
  • E2E re-run should show Gemini tests recovering

google-genai 2.0.0+ introduced breaking API changes (vertexai→enterprise
rename, new Interactions API structure). Fresh deploys on June 1 started
resolving to google-genai 2.7.0 via unpinned transitive dependencies,
causing runtime 500 errors on all Gemini-based e2e tests.

Pin google-genai to < 2.0.0 across all GoogleADK and LangGraph Gemini
templates to prevent the incompatible major version from being installed.
@notgitika notgitika requested a review from a team June 1, 2026 20:54
@jariy17 jariy17 merged commit b4f5daa into aws:main Jun 1, 2026
14 checks passed
@github-actions github-actions Bot added the size/xs PR size: XS label Jun 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 1, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 1, 2026
@agentcore-devx-automation
Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Package Tarball

aws-agentcore-0.16.0.tgz

How to install

gh release download pr-1433-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.16.0.tgz

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 1, 2026
@agentcore-cli-automation
Copy link
Copy Markdown

Reviewed post-merge — change looks good. The constraint google-genai >= 1.0.0, < 2.0.0 is compatible with the unpinned langchain-google-genai versions used in the templates:

  • langchain-google-genai 4.2.4 (latest, what fresh installs of >= 2.0.0 and >= 3.0.3 resolve to) requires google-genai >= 1.65.0, < 3.0.0, which intersects fine with < 2.0.0.
  • Older langchain-google-genai 2.x/3.x lines don't depend on google-genai directly, so adding it as an explicit dep doesn't create a conflict.
  • Snapshot updates match the template source changes.

One thing worth keeping in mind for follow-up (no change needed here): since langchain-google-genai itself is not upper-bounded, a future release of it that requires google-genai >= 2.0.0 will conflict with this pin. Might be worth pinning langchain-google-genai to a known-good major as well in a future PR, but that's out of scope for this hotfix.

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

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants