Skip to content

SequentialAgent doesn't execute sub agents after the first one. #573

Closed

Description

@gench

I tried to run the SequentialAgent example in the adk tutorial.

root_agent = SequentialAgent(
    name="CodePipelineAgent",
    sub_agents=[code_writer_agent, code_reviewer_agent, code_refactorer_agent],
    description="Executes a sequence of code writing, reviewing, and refactoring."
)

The code above doesn't continue after code_writer_agent and I dont see anything except 'generated_code' from the first agent in session.state.

If I run them manually as below, then everything works.

    await call_agent_async(
        query,
        Runner(agent=code_writer_agent, app_name=APP_NAME, session_service=session_service),
        USER_ID,
        SESSION_ID
    )

    await call_agent_async(
        "",  # No new user query, just use state
        Runner(agent=code_reviewer_agent, app_name=APP_NAME, session_service=session_service),
        USER_ID,
        SESSION_ID
    )

Desktop (please complete the following information):

  • OS: MacOS 15.4.1
  • Python version(python -V): Python 3.10.11
  • ADK version(pip show google-adk): 0.4.0
  • I tried Google Flash and LiteLLM with GPT-4o.

Activity

  1. theainerd commented on May 6, 2025

    @theainerd

    Sequential is working well on my end. Could you give the sequential agent a try in adk web too.

  2. added
    core
    on May 6, 2025
  3. added theissue type on May 6, 2025
  4. gench commented on May 8, 2025

    @gench
    Author

    I can't run the web, I need to run it as a python module.

  5. mr8lu commented on May 14, 2025

    @mr8lu

    I got the same issue. Running locally for testing. @theainerd when you saus it works well on your end, do you setup OAuth or any additional configurations?

  6. gench commented on May 18, 2025

    @gench
    Author

    I can confirm everything works when running it with adk web, but I need to run this as a standard Python module. It's concerning for the prospect of this framework that your own example doesn't work properly, and it's been over two weeks without anyone addressing this issue.

  7. Jacksunwei commented on May 18, 2025

    @Jacksunwei
    Collaborator

    @gench we have a few main.py files added for reference to use google-adk as python module in the contributing/samples folder.

    E.g. https://github.com/google/adk-python/blob/main/contributing/samples/hello_world/main.py


    In the meanwhile, I have a pending change to update the related sample contributing/samples/workflow_agent_seq with a main.py and sample output.

    Hope that will address your question.

  8. Jacksunwei commented on May 18, 2025

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

Metadata

Metadata

Assignees

Labels

core

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions