Files
agent-framework/python/packages
T
Giles Odigwe d02051dbb6 Python: Add propagate_session to as_tool() for session sharing in agent-as-tool scenarios (#4439)
* Python: Add propagate_session parameter to as_tool() for session sharing

Add opt-in session propagation in agent-as-tool scenarios. When
propagate_session=True, the parent agent's AgentSession is forwarded
to the sub-agent's run() call, allowing both agents to share session
state (history, metadata, session_id).

- Add propagate_session parameter to BaseAgent.as_tool() (default False)
- Include session in additional_function_arguments so it flows to tools
- Add 3 tests for propagation on/off and shared state verification
- Add sample showing session propagation with observability middleware

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify propagate_session docstring per review feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d02051dbb6 ยท 2026-03-04 23:14:17 +00:00
History
..
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00
2026-03-04 16:49:48 +00:00