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

Agent Engine deployments do not work after latest release

Open rrondir opened this issue 1 year ago • 17 comments

Using a basic agent with

root_agent = Agent( model="gemini-2.5-pro", name=..., instruction=...., description=...., tools=[my_tool] )

Fails to get queried in agentspace with error:

AttributeError: 'LlmAgent' object has no attribute 'static_instruction'. Did you mean: 'global_instruction'?

Reverting to 1.14.1 fixes the issue

rrondir avatar Sep 30 '25 19:09 rrondir

Hi, there were people who ran into similar issues and it was resolved when they pinned to google-adk>=1.15.1 both locally and in their requirements.txt file when they're deploying to AgentEngine. Can I check if that works for you?

yeesian avatar Oct 01 '25 15:10 yeesian

Based on the cloudbuild logs it installed google-adk-1.15.1, The issue still persisted

rrondir avatar Oct 01 '25 16:10 rrondir

~I'm also having this issue even after pinning to version 1.14.1 and redeploying my agent.~

AttributeError: 'LlmAgent' object has no attribute 'static_instruction'. Did you mean: 'global_instruction'?

Nevermind. Specifying the version 1.15.1 and redeploying the agent now gives me successful messages

zinabat avatar Oct 01 '25 18:10 zinabat

Based on the cloudbuild logs it installed google-adk-1.15.1, The issue still persisted

Thanks for chiming in! Can I check what version of google-genai it picked up?

yeesian avatar Oct 01 '25 19:10 yeesian

Based on the cloudbuild logs it installed google-adk-1.15.1, The issue still persisted

Thanks for chiming in! Can I check what version of google-genai it picked up?

It's 1.39.1

rrondir avatar Oct 01 '25 19:10 rrondir

Hello, does the bug still exist? I have the same problem.

dvdeveloper avatar Oct 09 '25 20:10 dvdeveloper

Hey Diego, I believe it is resolved but it is a bit tricky to get the right dependencies installed. This is what works for me:

remote_app = agent_engines.create(
  app,
  display_name="Agentic SOC Agent Engine",
  requirements=[
    "cloudpickle",
    "google-adk>=1.15.1",  # fixes AttributeError: 'LlmAgent' object has no attribute 'static_instruction'. Did you mean: 'global_instruction'
    "google-genai",
    "google-cloud-discoveryengine",
    "google-cloud-aiplatform[agent-engines]==1.119.0",  # fixes VertexAiSessionService
    ...

Note that I do NOT have adk in the google-cloud-aiplatform[...] and instead I'm explicitly installing it higher in the dependency list with google-adk>=1.15.1. I needed to upgrade both google-adk and google-cloud-aiplatform to resolve the issue. Also, I updated both in my local environment's venv where I build and in these dependencies for the agent itself.

I hope this works for you too!

dandye avatar Oct 09 '25 21:10 dandye

I confirm the issue using 1.119 or 1.120. I fixed the problem with the above approach.

falconcr avatar Oct 10 '25 17:10 falconcr

I faced same problem. I tried this one, but it's couldn't be solved.

agent_engine = agent_engines.create(
        display_name="test_agent",
        description="test_agent",
        agent_engine=app,
        gcs_dir_name="test_agent_engine",
        requirements=[
            "cloudpickle",
            "google-adk==1.15.1",
            "google-genai",
            "google-cloud-discoveryengine",
            "google-cloud-aiplatform[agent-engines]==1.119.0"
        ]
    )

hiracky16 avatar Oct 21 '25 05:10 hiracky16

I faced same problem. I tried this one, but it's couldn't be solved.

@hiracky16 Can you confirm that the error you receive is:

AttributeError: 'LlmAgent' object has no attribute 'static_instruction'. Did you mean: 'global_instruction'?

Also, are you using the exact same versions in the requirements.txt file for the venv that you are using?

dandye avatar Oct 21 '25 15:10 dandye

@dandye my requirements.txt is here.

cloudpickle
google-adk==1.15.1
google-genai
google-cloud-discoveryengine
google-cloud-aiplatform[agent-engines]==1.119.0
pydantic==2.11.7

hiracky16 avatar Oct 22 '25 01:10 hiracky16

@hiracky16 Can you also please confirm that the error you are seeing is:

AttributeError: 'LlmAgent' object has no attribute 'static_instruction'. Did you mean: 'global_instruction'?

dandye avatar Oct 22 '25 02:10 dandye

@dandye

The following error occurred (I observed it in Cloud Trace):

'LlmAgent' object has no attribute 'static_instruction'

I suspect this is because static_instruction was implemented starting from version v1.15.1.

I tried using the version(google-adk==1.14.1 and google-cloud-aiplatform[agent-engines]==1.113.0) specified in this requirements.txt, but I was unable to create the agent engine session because the error occurred.

requirements.txt

cloudpickle
google-adk==1.14.1
google-genai
google-cloud-discoveryengine
google-cloud-aiplatform[agent-engines]==1.113.0
pydantic==2.11.7

error

google.genai.errors.ClientError: 400 FAILED_PRECONDITION. {'error': {'code': 400, 'message': 'Reasoning Engine Execution failed.\nPlease refer to our documentation (https://cloud.google.com/vertex-ai/generative-ai/docs/agent-engine/troubleshooting/use) for checking logs and other troubleshooting tips.\nError Details: {"detail":"Agent Engine Error: An error occurred during invocation. Exception: Cannot send a request, as the client has been closed.\\nRequest Data: {\'user_id\': \'USER_ID\'}"}', 'status': 'FAILED_PRECONDITION'}}

hiracky16 avatar Oct 22 '25 02:10 hiracky16

I have the same problem here. I tried to download the modules, but I couldn't resolve it.

hugoub avatar Oct 24 '25 21:10 hugoub

The following set of requirements resolved the issue for me:

"cloudpickle", "google-adk>=1.17.0", "google-genai==1.49.0", "google-cloud-discoveryengine", "google-cloud-aiplatform[agent-engines]==1.125.0"

zeeqayyum avatar Nov 17 '25 17:11 zeeqayyum

I tried all the above methods, but the issue has persisted

swarajbande210698 avatar Dec 12 '25 10:12 swarajbande210698

The only explanation for this issue is that there is a different in versions of google-adk from the version that was used in the agent that was initialized for deployment, versus the version that was deployed.

To avoid this issue, either use the more recent version of google-adk, and use the same version across both local/deployment and remote/deployed environments, or use the source-based approach for deployment in https://docs.cloud.google.com/agent-builder/agent-engine/deploy#from-source-files

yeesian avatar Jan 12 '26 16:01 yeesian