-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Summary
When deploying an agent to Vertex AI Agent Engine using inline source deployment (source_packages, entrypoint_module, entrypoint_object) with agent_server_mode: EXPERIMENTAL, the deployment fails at runtime. The EXPERIMENTAL server runtime attempts to load the agent from a pickle file instead of using the inline source code.
Environment
- google-cloud-aiplatform: 1.135.0
- google-adk: latest
- Python: 3.11/3.12
- Region: us-central1
Steps to Reproduce
- Create an ADK agent with
AdkApp - Deploy using the GenAI SDK with inline source configuration:
client.agent_engines.create(config={
"source_packages": ["my_agent_package", "requirements.txt"],
"entrypoint_module": "runtime_wrapper",
"entrypoint_object": "adk_app",
"class_methods": [...],
"agent_server_mode": vertexai_types.AgentServerMode.EXPERIMENTAL,
})- Deployment completes but the agent fails to start
Expected Behavior
The agent should start successfully using the inline source code, similar to how it works without agent_server_mode: EXPERIMENTAL.
Actual Behavior
The agent fails with the following error in Cloud Logging:
FileNotFoundError: [Errno 2] No such file or directory: 'user_code/code.pkl'
Stack trace shows the EXPERIMENTAL server runtime expects a pickle file:
File "/code/server.py", line 61, in serve
servicer = service_builder.construct_service(pickle_file)
File "/code/service_builder.py", line 349, in construct_service
obj = utils.get_object(python_file_name)
Analysis
The issue appears to be that:
- Without EXPERIMENTAL mode: The server runtime correctly uses inline source (entrypoint_module + entrypoint_object)
- With EXPERIMENTAL mode: A different server runtime is used that only supports pickle-based deployment
Removing agent_server_mode: EXPERIMENTAL from the config allows the same agent to deploy and run successfully with inline source.
Questions
- Is this a known limitation of EXPERIMENTAL mode?
- Is there a timeline for inline source support in EXPERIMENTAL mode?
- Is pickle-based deployment currently the only supported method for bidirectional streaming agents?
Workaround
Currently, the only workaround is to use pickle-based deployment (with staging_bucket and agent= parameters) for agents requiring EXPERIMENTAL mode, which introduces complexity around GCS bucket management and pickle serialization compatibility.