Skip to content

fix: align app_name with Cloud ML Job ID in deployed environments#6624

Open
EaCognitive wants to merge 4 commits intogoogleapis:mainfrom
EaCognitive:fix-appname-mismatch
Open

fix: align app_name with Cloud ML Job ID in deployed environments#6624
EaCognitive wants to merge 4 commits intogoogleapis:mainfrom
EaCognitive:fix-appname-mismatch

Conversation

@EaCognitive
Copy link
Copy Markdown

Problem

When an AdkApp is deployed to Vertex AI Agent Engine, there is often a mismatch between the local app.name and the Resource ID assigned by the backend. The SDK currently uses the local name for artifact lookups, leading to 404 errors because the deployment infrastructure expects the Resource ID.

Solution

Updated AdkApp._app_name() to check for the CLOUD_ML_JOB_ID environment variable. If present (indicating a deployed environment), the method returns this ID, ensuring consistency with the backend's expectations for artifact storage and lookup.

Changes

  • vertexai/agent_engines/templates/adk.py: Added environment variable check to _app_name().

Verification

  • Verified that the logic correctly prioritizes the environment variable over the local name when available.

@EaCognitive EaCognitive requested a review from a team as a code owner April 21, 2026 20:06
@product-auto-label product-auto-label Bot added size: xs Pull request size is extra small. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Apr 21, 2026
@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Apr 24, 2026
@EaCognitive
Copy link
Copy Markdown
Author

Updated with current main and adjusted the app-name regression test for the upstream ADK version check. Local validation: uv run ... pytest tests/unit/vertex_adk/test_agent_engine_templates_adk.py -k 'test_default_app_name_uses_agent_engine_id or test_initialization_keeps_explicit_app_name or test_default_app_name_uses_fallback_without_agent_engine_id' -> 3 passed. Requesting maintainer review when available.

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

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant