You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Static Instruction won't work with agents that have sub_agents=[] #3212
Describe the bug
Static Instructions won't work for an entry point agent who has a pipeline of agents as a sub_agent. We have an entry team leader agent that receives the user input and transfers the job to a complicated pipeline of agents. I got to set the App() at the end of this agent in order set the ContextCaching, but no luck getting static_instructions working there.
Expected behavior
I would expect that my entry point agent could have a long monolithic static instruction that could be passed and used as a collective memory to drive the rest of the team's behavior. I used the feature tho, but in a loop_agent with a critic pattern that I have later in the flow.
Are you using LiteLLM: Yes (I'm using OpenAI through LiteLLM because it's the company model standard)
Instead of using a long monolithic static instruction, the recommended alternative here would instead to use agent descriptions (https://google.github.io/adk-docs/agents/multi-agents), in addition to setting the instructions at the base agent. The sub-agent's descriptions are what are used at runtime for designation and transfers, and should help resolve this scenario.
For now, we would be hesitant to expose the private _invocation_context from the CallbackContext. Even with the disclaimer of only being intended for plugin development, there would be no way to only allow the access of these values for certain use cases, but not others.
@speedstorm1
This issue is caused by a simple error in accessing an unaccessible variable in the GlobalInstuctionPlugin. It must be fixed with either this PR or #3180, or an equivalent method.
The ADK marks global_instruction as deprecated. However, migrating from a deprecated change will prevent the ADK from calling the Always condition.
Activity
speedstorm1 commentedon Oct 28, 2025
@speedstorm1 - I can work on this
juanfcastropiccolo commentedon Oct 28, 2025
@speedstorm1 I think I fixed it tweaking the GlobalInstructionPlugin class: #3216
speedstorm1 commentedon Oct 29, 2025
Hi @juanfcastropiccolo ,
Instead of using a long monolithic static instruction, the recommended alternative here would instead to use agent descriptions (https://google.github.io/adk-docs/agents/multi-agents), in addition to setting the instructions at the base agent. The sub-agent's descriptions are what are used at runtime for designation and transfers, and should help resolve this scenario.
For now, we would be hesitant to expose the private _invocation_context from the CallbackContext. Even with the disclaimer of only being intended for plugin development, there would be no way to only allow the access of these values for certain use cases, but not others.
UlookEE commentedon Nov 3, 2025
@speedstorm1
This issue is caused by a simple error in accessing an unaccessible variable in the GlobalInstuctionPlugin. It must be fixed with either this PR or #3180, or an equivalent method.
The ADK marks global_instruction as deprecated. However, migrating from a deprecated change will prevent the ADK from calling the Always condition.
UlookEE commentedon Nov 3, 2025
Apps that have currently migrated to this feature must customize the GlobalInstructionPlugin.
Please Help.
GWeale commentedon Nov 3, 2025
@UlookEE Reviewing PR now I see the problem, will accept PR. Thank you
juanfcastropiccolo commentedon Nov 3, 2025
@GWeale @UlookEE lovely! thanks for the help!! :)