Skip to content

Static Instruction won't work with agents that have sub_agents=[] #3212

Closed

Description

@juanfcastropiccolo

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)
  • Which model is being used: gpt-5 and gpt-4.1-nano

Activity

  1. added
    core[Component] This issue is related to the core interface and implementation
    on Oct 18, 2025
  2. added theissue type on Oct 18, 2025
  3. added this to the 10/27 ADK Week milestone on Oct 23, 2025
  4. speedstorm1 commented on Oct 28, 2025

    @speedstorm1
    Member

    @speedstorm1 - I can work on this

  5. juanfcastropiccolo commented on Oct 28, 2025

    @juanfcastropiccolo
    Author

    @speedstorm1 I think I fixed it tweaking the GlobalInstructionPlugin class: #3216

  6. speedstorm1 commented on Oct 29, 2025

    @speedstorm1
    Member

    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.

  7. UlookEE commented on Nov 3, 2025

    @UlookEE
    Contributor

    @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.

  8. UlookEE commented on Nov 3, 2025

    @UlookEE
    Contributor

    Apps that have currently migrated to this feature must customize the GlobalInstructionPlugin.
    Please Help.

  9. GWeale commented on Nov 3, 2025

    @GWeale
    Collaborator

    @UlookEE Reviewing PR now I see the problem, will accept PR. Thank you

  10. juanfcastropiccolo commented on Nov 3, 2025

    @juanfcastropiccolo
    Author

    @GWeale @UlookEE lovely! thanks for the help!! :)

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

Metadata

Metadata

Labels

core[Component] This issue is related to the core interface and implementation

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions