Skip to content

v0.5.0: deploy to agent_runtime builds on the CLI's own Python (sys.version_info), not the project's — fails when a dependency lacks a wheel for that version (e.g. Python 3.14 + litellm) #36

@qingvincentyin

Description

@qingvincentyin

Summary

agents-cli deploy to --deployment-target agent_runtime (Vertex AI Agent Engine) determines the build/runtime Python version from the interpreter that runs the CLI itself, not from the target project's Python. When agents-cli is installed as a uv tool under a Python that some required dependency doesn't support yet, the server-side build fails with only a generic error. Concretely, with the CLI running on Python 3.14, the build fails because litellm (a transitive dependency of google-adk) has no 3.14-compatible release. This also builds on a Python version that the generated project's own pyproject.toml requires-python = ">=3.11,<3.14" excludes.

Environment

  • agents-cli v0.5.0 (installed as a uv tool; uv 0.11.14)
  • CLI tool environment interpreter: Python 3.14.5 (machine default)
  • Project: scaffolded adk template, --deployment-target agent_runtime, requires-python = ">=3.11,<3.14"

Repro

  1. Have agents-cli installed under Python 3.14 (e.g. uv tool install google-agents-cli on a machine whose default Python is 3.14).
  2. Scaffold an adk agent targeting agent_runtime.
  3. agents-cli deploy --project <PROJECT_ID> --update-env-vars "GOOGLE_CLOUD_LOCATION=global,GOOGLE_GENAI_USE_VERTEXAI=True"

Actual

Error: Deployment failed: {'code': 3, 'message': 'Build failed. The issue might be caused by incorrect code, requirements.txt file or other dependencies. ...'}

The real error is only visible server-side in Cloud Logging (resource.type="aiplatform.googleapis.com/ReasoningEngine"):

ERROR: Ignored the following versions that require a different python version: ... 1.85.4 Requires-Python >=3.10,<3.14 ...
ERROR: Could not find a version that satisfies the requirement litellm==1.85.4
ERROR: No matching distribution found for litellm==1.85.4

Build install paths confirm the builder ran on 3.14 (.venv/lib/python3.14/..., cp314 wheels).

Expected

The deploy should build on a Python compatible with the project (its .venv / requires-python), or fail fast with a clear message instead of a generic server-side build failure.

Root cause

The Agent Engine SDK derives the build version from the calling interpreter when no override is passed — vertexai/_genai/agent_engines.py:

if python_version:
    sys_version = python_version
else:
    sys_version = f"{sys.version_info.major}.{sys.version_info.minor}"

agents-cli does not pass python_version, so the build inherits the CLI's own interpreter (3.14). There is no --python-version flag to override it.

Likely a regression in v0.5.0

The same project deployed successfully on agents-cli v0.3.0, with the CLI on the same Python 3.14 tool environment, even though litellm has never supported 3.14. That implies v0.3.0 derived the build Python from the project (≤3.13), and v0.5.0 changed to the sys.version_info fallback. (Stated as an inference from observed behavior, not a code diff.)

Suggested fixes (in order of preference)

  1. Set the deploy python_version from the Python the requirements were resolved against (the project .venv / uv.lock).
  2. Otherwise honor the project's requires-python upper bound (don't build on an excluded version).
  3. At minimum, add a --python-version flag and warn when the build Python differs from the resolution Python.

Workaround

Run the CLI under a supported Python: uvx --python 3.13 --from google-agents-cli agents-cli deploy ..., or durably uv tool install google-agents-cli --python 3.13.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions