Skip to content

Agent-as-a-Tool uses InMemorySessionService #2754

Closed

Description

@dgnk007

Description

While integrating Agent-as-a-Tool into my parent agent, I noticed that all internal actions executed by the tool are not being stored in the database events.

After checking the source code, it seems that the Agent-as-a-Tool implementation is always using InMemorySessionService, and there’s no option to switch to a persistent session service. Because of this, any actions or interactions handled by the tool are lost after execution.

Actual Behaviour

  • Internal actions are executed but not saved in the database.
  • The session is always stored in memory, making the events unavailable for later retrieval or debugging.

Expected Behaviour

I expected the Agent-as-a-Tool to respect the parent agent’s configured session service (e.g., database-backed) so that all actions and events (Maybe in a different branch) are properly persisted.

tools=[AgentTool(agent=summary_agent, skip_summarization=True,persistent=True)]

Questions

  • Is this design intentional (to keep tool sessions lightweight and ephemeral)?
  • If not, would it make sense to allow configuration of the session service, so we can persist tool actions just like normal agent actions?

Activity

  1. added
    services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc
    on Aug 27, 2025
  2. added theissue type on Aug 27, 2025
  3. hangfei commented on Nov 4, 2025

    @hangfei
    Collaborator

    @dgnk007 thanks for sharing the feedback.

    This is a feature request.

  4. changed the issue type fromtoon Nov 4, 2025
  5. klateefa commented on Nov 25, 2025

    @klateefa

    @dgnk007 Thank you for reporting this. I understand the request is currently under review. Please keep me posted if anything else is needed. Thanks for your patience.

  6. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Nov 25, 2025
  7. self-assigned this
    on Aug 6, 2026
  8. GWeale commented on Aug 6, 2026

    @GWeale
    Collaborator

    thanks for flagging this, attach the sub-agent with mode='single_turn' in sub_agents instead of AgentTool, and it runs inline so the parent session records the events. direct AgentTool use is discouraged for that reason.

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

Metadata

Metadata

Labels

needs review[Status] The PR/issue is awaiting review from the maintainerservices[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions