adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

google-adk[gcp] pins google-cloud-discoveryengine<0.14, which blocks protobuf 7

Open TomShlaim opened this issue 3 weeks ago • 5 comments

🔴 Required Information

Describe the Bug:

The gcp extra pins google-cloud-discoveryengine>=0.13.12,<0.14 (pyproject.toml:272; the same pin sits in the all extra at :102 and the test extra at :373). The only release that pin allows, 0.13.12, requires protobuf<7.0.0; so do 0.14.0 through 0.17.0. google-adk[gcp] therefore cannot be installed next to protobuf 7, or next to anything that needs it. Code generated by grpcio-tools>=1.82 is one example: its _pb2 modules call ValidateProtobufRuntimeVersion(..., 7, 35, 0, ...) and refuse a 6.x runtime.

The pin is conservative. google-cloud-discoveryengine 0.18.0 (March 2026) allows protobuf<8.0.0, and 0.20.6 (2026-11-05) is the current release. The library's CHANGELOG lists no breaking change between 0.13.12 and 0.20.6. ADK uses only the discoveryengine_v1beta search surface (SearchServiceClient, SearchRequest, Chunk, Document) in tools/discovery_engine_search_tool.py.

Steps to Reproduce:

  1. python3.12 -m venv v && v/bin/pip install "google-adk[gcp]==2.14.0" "protobuf>=7"
  2. For comparison: python3.12 -m venv v2 && v2/bin/pip install "google-adk[gcp]==2.14.0", then v2/bin/pip show google-cloud-discoveryengine protobuf

Expected Behavior:

Step 1 installs. The gcp extra resolves with protobuf 7 and a current google-cloud-discoveryengine.

Observed Behavior:

Step 1:

ERROR: Cannot install google-adk and protobuf>=7 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested protobuf>=7
    google-cloud-discoveryengine 0.13.12 depends on protobuf!=4.21.0, !=4.21.1, !=4.21.2, !=4.21.3, !=4.21.4, !=4.21.5, <7.0.0 and >=3.20.2

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Step 2 resolves to google-cloud-discoveryengine 0.13.12 and protobuf 6.33.6.

Environment Details:

  • ADK Library Version (pip show google-adk): 2.14.0 (the pin is unchanged since 2.3.0)
  • Desktop OS: macOS 15
  • Python Version (python -V): Python 3.12.8

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: N/A (dependency resolution only)

🟡 Optional Information

Regression: No. The pin is unchanged; the protobuf 7 ecosystem moved around it.

Logs: See Observed Behavior.

Screenshots / Video: N/A

Additional Context: Workaround in use: hold grpcio-tools<1.82 and protobuf 6.x. A PR that raises the ceiling to <1.0 follows.

Minimal Reproduction Code: N/A, see Steps to Reproduce.

How often has this issue occurred?: Always (100%)

TomShlaim avatar Nov 09 '26 13:11 TomShlaim

@TomShlaim, confirmed on 2.14.1. One heads-up: on the full [gcp] extra pip blames google-cloud-agentplatform, but agentplatform resolves fine with protobuf 7 on its own. The <0.14 discoveryengine pin is what blocks it.

Until this lands, a workaround is to install plain google-adk plus the gcp extra deps yourself with google-cloud-discoveryengine>=0.18,<1. In my dry-run that resolved to protobuf 7.36.2 and discoveryengine 0.20.7.

For #8057, could you consider >=0.18 as the minimum so resolvers can’t land on 0.14-0.17, which still cap protobuf<7? Could you also rerun the discovery engine tests against 0.20.7, since it came out after your run?

Once those tests pass on your side, we can get it reviewed.

surajksharma07 avatar Nov 13 '26 07:11 surajksharma07

@surajksharma07 Thanks!

Agreed on the floor: 0.14-0.17 still cap protobuf<7, so I changed the range to >=0.18,<1 locally and reran the two search-tool test files against 0.20.7: 57 passed (protobuf 7.36.2).

One question before I push: With the new floor the update-constraints check fails, since the constraints files pin 0.13.12. Running scripts/update_constraints.sh fixes it but refreshes every pin in all five files (~7k changed lines). Do you want that in this PR, or should I push only the pyproject change and leave the constraints refresh to you?

TomShlaim avatar Nov 15 '26 09:11 TomShlaim

Thanks @TomShlaim for rerunning those. I’d keep the full refresh out of this PR, since a 7k-line constraints diff would be hard to review next to a 3-line fix. We’ll handle that separately.

The script only rewrites everything because update mode moves the date to today minus 4 days and drops the old pins once 0.13.12 conflicts. A targeted refresh works instead: rebase on main (the constraints are now dated --exclude-newer 2026-11-05), remove the google-cloud-discoveryengine== line from each constraints file, and re-resolve the way --check does, with the recorded date and the existing pins as -c. Name that file constraints-.txt.stable.tmp so the “via” comments match.

When I tried it on 3.12 the only pin that changed was google-cloud-discoveryengine 0.13.12 -> 0.20.5, and protobuf stayed at 6.33.6. That should be only a few lines per file, and --check should pass afterwards.

Please push that together with the >=0.18,<1 range and I’ll get the workflows approved and the PR reviewed.

surajksharma07 avatar Nov 18 '26 06:11 surajksharma07

@surajksharma07 done, pushed to #8057:

  • Range is now >=0.18,<1 in the gcp, test and all extras.
  • Rebased on main and re-resolved the five constraints files with the recorded date and the existing pins. The only pin that moves is google-cloud-discoveryengine 0.13.12 -> 0.20.6 (0.20.6 was released on 2026-11-05, inside the recorded --exclude-newer date, which is why it is not the 0.20.5 of your dry run); protobuf stays 6.33.6. scripts/update_constraints.sh --check passes.
  • Search-tool tests: 57 passed with the constrained set (discoveryengine 0.20.6, protobuf 6.33.6), and 57 passed earlier against 0.20.7 with protobuf 7.36.2.

TomShlaim avatar Nov 23 '26 10:11 TomShlaim

Thanks @TomShlaim, that's exactly the shape I was hoping for: 6 files, +18/-8, and the only pin that moves is discoveryengine 0.13.12 -> 0.20.6 with protobuf staying at 6.33.6. main and 2.15.0 still have >=0.13.12,<0.14, so this is still needed.

Merged dd033ce onto today's main, which also has 163bfc0 (google-genai <4), and re-ran the --check resolution for all five Pythons on Linux in UTC. All five come out identical to your files, so CI should be green.

The 0.20.5 vs 0.20.6 thing was on my end. uv reads a bare --exclude-newer date as the end of that day in the machine's local time zone. 0.20.6 went up at 18:39 UTC on Nov 5, which is already Nov 6 here in IST, so my dry run couldn't see it. It does mean the pre-commit --check can fail for anyone east of UTC until the date moves, but that's a script issue for a separate change, not this PR.

Nothing else needed from you. @xuanyang15 could you approve the 2 pending workflows on #8057 and review it when you get a chance?

surajksharma07 avatar Nov 24 '26 20:11 surajksharma07