[Agent Engine][Adk] app_name mismatch between AdkApp._tmpl_attrs and Runner causes GCS artifact lookup failures in Agent Engine
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Comienza en vertexai.agent_engines.templates.adk e inspecciona AdkApp.set_up(); después compara su app_name de la plantilla con Runner._validate_runner_params y _convert_response_events. Reproduce la ruta de guardado/carga del artefacto utilizando el entorno de Agent Engine descrito y confirma que el nombre de la ADK App envuelta se usa de forma coherente sin depender de la GOOGLE_CLOUD_AGENT_ENGINE_ID numérica.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment details
- OS type and version: Linux (Vertex AI Agent Engine environment)
- Python version:
Python 3.11+ google-cloud-aiplatformversion:1.143.0
Steps to reproduce
- Create an agent via Google ADK exposing tools that generate or return visual artifacts (images/videos) using
tool_context.save_artifact(). - Instantiate and wrap the ADK agent into a Vertex AI SDK template using
AdkApp(fromvertexai.agent_engines.templates.adk). - Deploy this agent to Agent Engine (Vertex AI platform container mapping to Gemini Enterprise).
- Trigger any tool that saved an artifact from the UI chat.
Root Cause Analysis
The issue occurs because the application name used by the container falls back onto the ID assigned by the Cloud platform if not explicitly provided, while the Runner defaults to the name defined in the ADK App instance.
In AdkApp.set_up(), the fallback logic is as follows:
# AdkApp.set_up() fallback logic
if not self._tmpl_attrs.get("app_name"):
if "GOOGLE_CLOUD_AGENT_ENGINE_ID" in os.environ:
self._tmpl_attrs["app_name"] = os.environ.get(
"GOOGLE_CLOUD_AGENT_ENGINE_ID",
)
else:
self._tmpl_attrs["app_name"] = _DEFAULT_APP_NAME
However, the Runner created later defaults to app.name (the static default "app" in ADK if not overridden):
# Runner._validate_runner_params defaults to app.name
app_name = app_name or app.name # resolves to "app" instead of the ID
This creates a mismatch failure during session artifact reads in _convert_response_events.
Actual Behavior
-
Save Path evaluates using
app.name(e.g.,"app"or a custom name like"mova"):
GCS_BUCKET/app/{user_id}/{session_id}/artifact.png -
Load Path evaluates using
AdkApp._tmpl_attrs["app_name"](e.g., the numerical ID assigned by Google Cloud):
GCS_BUCKET/8269664996770709504/{user_id}/{session_id}/artifact.png
Because strings like "app" and "8269664996770709504" on bucket paths do not map identically, files aren't found on state loads, and the Gemini Enterprise UI draws empty boxes or fails to render the media.
Moreover, if the user tries to use GOOGLE_CLOUD_AGENT_ENGINE_ID directly to solve the mismatch, the purely numerical ID causes Pydantic validation failures on boot because it is not a valid Python identifier (starts with a digit).
Expected Behavior
The AdkApp should ensure that the app_name in its template attributes matches the name of the ADK App being wrapped, or provide a clean way to synchronize them, rather than falling back to the numerical GOOGLE_CLOUD_AGENT_ENGINE_ID.
Workaround Applied
To fix this manually in user code, one can override _tmpl_attrs["app_name"] after calling super().set_up() in the custom AdkApp class:
class AgentEngineApp(AdkApp):
def set_up(self) -> None:
super().set_up()
# Enforce that AdkApp uses the same name as the ADK App
self._tmpl_attrs["app_name"] = adk_app.name
- Lenguaje dominante
- Python
- Estrellas
- 907
- Forks
- 467
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 40
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/python-aiplatform
-
Protobuf 7.35.1+ support Abiertoapi: vertex-ai
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
googleapis/python-aiplatform#7132 ·
-
api: vertex-ai
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/python-aiplatform#7097 ·
-
CustomContainerTrainingJob.run drops max_wait_duration=0 instead of requesting indefinite DWS wait Abiertoapi: vertex-ai
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/python-aiplatform#7067 · 1 comentario ·
-
api: vertex-ai
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/python-aiplatform#6877 ·
-
api: vertex-ai
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/python-aiplatform#6865 · 1 comentario ·
Todos los issues de googleapis/python-aiplatform
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
huggingface/Repo2RLEnv#163 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NousResearch/hermes-agent#121143 ·