Skip to content

Commit f062ccf

Browse files
Luiclaude
andcommitted
fix(infra): upgrade google-adk for Gemini 3.x thought_signature support
Pro (gemini-3.1-pro-preview) fails with 400 BadRequest after multiple tool calls because google-adk==1.18.0 drops thought_signatures during FunctionCall conversions. Gemini 3.x requires thought_signatures in multi-turn tool calling sessions. Fix: force-install google-adk>=1.23.0 (which preserves thought_signatures) alongside the existing litellm>=1.82.0 override. See: google/adk-python#3705 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Lui <[email protected]>
1 parent a38a8d8 commit f062ccf

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎medexpert/infra/Dockerfile.medliaison‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
99
# Install SAM from PyPI (clean, no build hook)
1010
RUN pip install --no-cache-dir "solace-agent-mesh==1.16.4"
1111

12+
# Upgrade litellm for Gemini 3.x thought_signature support.
13+
# SAM pins litellm==1.76.3 which lacks thought_signature handling
14+
# required by gemini-3.1-pro-preview (400 BadRequest on multi-turn tool calls).
15+
# litellm>=1.82.0 auto-extracts and preserves thought_signatures.
16+
RUN pip install --no-cache-dir "litellm>=1.82.0,<2.0"
17+
1218
# Install medexpert
1319
COPY pyproject.toml .
1420
COPY src/ src/

‎medexpert/infra/Dockerfile.v2‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ RUN pip install --no-cache-dir mcp-memgraph
2222
# SAM pins litellm==1.76.3 which predates these models. The override installs 1.82.0
2323
# without re-resolving SAM's dependency tree (--force-reinstall --no-deps).
2424
# Verified: gemini-2.5-flash works correctly under 1.82.0 (backward compatible).
25-
RUN pip install --force-reinstall --no-deps "litellm>=1.81.14,<2.0.0"
25+
RUN pip install --force-reinstall --no-deps "litellm>=1.82.0,<2.0.0"
26+
27+
# Override google-adk for Gemini 3.x thought_signature support.
28+
# SAM 1.16.4 pins google-adk==1.18.0 which predates thought_signature handling.
29+
# Gemini 3.x models (gemini-3.1-pro-preview) require thought_signatures in multi-turn
30+
# tool calls — without them, the model returns 400 BadRequest after multiple tool uses.
31+
# ADK 1.23.0+ preserves thought_signatures in FunctionCall conversions.
32+
# See: https://github.com/google/adk-python/issues/3705
33+
RUN pip install --force-reinstall --no-deps "google-adk>=1.23.0,<2.0.0"
2634

2735
# Cold store data directory
2836
RUN mkdir -p /app/data

0 commit comments

Comments
 (0)