Skip to content

agents-cli run <prompt> appears to ignore root agent instructions #7

@gbmerrall

Description

@gbmerrall

What happened?

When create a basic default agent and modify the root agent instructions, the playgound works as expected but running the cmdline version returns output from the tools exactly as returned, bypassing the root agent instructions.

Steps to Reproduce

  1. Run agents-cli create my-first-agent --prototype --yes
  2. cd my-first-agent
  3. agents-cli install
  4. Edit app/agent.py and change the root agent instructions. In my case I added "You talk like a pirate"
  5. Run the playground with agents-cli playground and ask about the weather in San Fancisco. You get an appropriate pirate response.
  6. Stop the server and run the cmdline version
agents-cli run "What's the weather in San Francisco?"
Using project root directory: /Users/gbmerrall/Code/sandbox/agent_cli/my-agent
[user]: What's the weather in San Francisco?
[root_agent]: It's 60 degrees and foggy.

What did you expect to happen?

The cmdline version should use the root agent instructions and return the apprpriate response. In my case, pirate speak

Client information

Client Information CLI version: 0.1.1 CLI install path: /Users/gbmerrall/.local/share/uv/tools/google-agents-cli/lib/python3.12/site-packages/google/agents/cli Installed skills: none

Project root: /Users/graeme/Code/sandbox/agent_cli/my-agent
Project name: my-agent
Deployment target: none
Agent directory: app
Region: us-east1

Command Output / Logs

$ agents-cli run --verbose "What's the weather in San Francisco?"
Using project root directory: /Users/gbmerrall/Code/sandbox/agent_cli/my-agent
[user]: What's the weather in San Francisco?
[root_agent]:
{
"modelVersion": "gemini-flash-latest",
"content": {
"parts": [
{
"functionCall": {
"id": "adk-23300ce5-193c-4675-b6b1-6e51c31a8ef1",
"args": {
"query": "San Francisco"
},
"name": "get_weather"
}
}
],
"role": "model"
},
"finishReason": "STOP",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 154,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 154
}
],
"totalTokenCount": 164,
"trafficType": "ON_DEMAND"
},
"avgLogprobs": -0.04148182570934296,
"invocationId": "e-17683ff1-7654-4269-b3e5-2f7490ad18ea",
"author": "root_agent",
"actions": {
"stateDelta": {},
"artifactDelta": {},
"requestedAuthConfigs": {},
"requestedToolConfirmations": {}
},
"longRunningToolIds": [],
"id": "38fc68ad-c7a6-4747-9f3a-1f0ccd6116b2",
"timestamp": 1776992831.916116
}

{
"content": {
"parts": [
{
"functionResponse": {
"id": "adk-23300ce5-193c-4675-b6b1-6e51c31a8ef1",
"name": "get_weather",
"response": {
"result": "It's 60 degrees and foggy."
}
}
}
],
"role": "user"
},
"invocationId": "e-17683ff1-7654-4269-b3e5-2f7490ad18ea",
"author": "root_agent",
"actions": {
"stateDelta": {},
"artifactDelta": {},
"requestedAuthConfigs": {},
"requestedToolConfirmations": {}
},
"id": "231eeac7-af78-468f-98fd-6c73fbc17f11",
"timestamp": 1776992834.07905
}
The weather in San Francisco is 60 degrees and foggy.
{
"modelVersion": "gemini-flash-latest",
"content": {
"parts": [
{
"text": "The weather in San Francisco is 60 degrees and foggy."
}
],
"role": "model"
},
"finishReason": "STOP",
"usageMetadata": {
"candidatesTokenCount": 13,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 13
}
],
"promptTokenCount": 174,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 174
}
],
"totalTokenCount": 187,
"trafficType": "ON_DEMAND"
},
"avgLogprobs": -0.025818485480088454,
"invocationId": "e-17683ff1-7654-4269-b3e5-2f7490ad18ea",
"author": "root_agent",
"actions": {
"stateDelta": {},
"artifactDelta": {},
"requestedAuthConfigs": {},
"requestedToolConfirmations": {}
},
"id": "76eadd2c-4fca-48fc-ad35-f79372933bb1",
"timestamp": 1776992834.083573
}

Session: 2784b6c7-0b19-4794-8578-d361905ba14c (resume with --session-id)

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions