feat(tools): add propagate_conversation_history option to AgentTool#6020
feat(tools): add propagate_conversation_history option to AgentTool#6020GiulioCMSanto wants to merge 1 commit into
Conversation
|
Response from ADK Triaging Agent Hello @GiulioCMSanto, thank you for creating this PR! It looks like a great addition to While you have provided an excellent description of your manual E2E test, to fully align with our contribution guidelines, could you please provide:
This information will help reviewers verify and understand the changes more efficiently. Thank you! |
|
I will start by reading the instructions in the The complete and detailed pull request analysis is available in the created artifact: Executive Summary of the PR
|
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Testing Plan
Unit Tests:
New tests added to
tests/unittests/tools/test_agent_tool.py:test_propagate_history_injects_user_and_model_eventstest_propagate_history_excludes_function_call_eventstest_propagate_history_creates_events_without_state_deltastate_delta(prevents child state corruption)test_propagate_history_disabled_by_defaultFalsebehavior is unchanged — zero history in childtest_propagate_history_child_sees_context_end_to_endManual End-to-End (E2E) Tests:
Tested with a multi-turn conversational agent where a parent routes to a tool agent for filter extraction. Without
propagate_conversation_history=True, the child misclassifies user constraints (treats mandatory requirements as soft preferences). With it enabled, the child correctly identifies non-negotiable requirements from the full conversation context.Checklist
Additional context
Implementation follows the
propagate_grounding_metadatapattern exactly:propagate_conversation_history: bool = FalseonAgentTool.__init___inject_conversation_historymodule-level helper (~25 lines)run_asyncaftercreate_session_TaskAgentTool.__init__Not modified (intentionally):
_SingleTurnAgentTool— usesrun_node(parent already shares context)AgentToolConfig/from_config— matching precedent (propagate_grounding_metadatadidn't wire through config either)Design decisions:
False— existing behavior unchanged for all current users.user/modeltext events are injected —function_call/function_responseevents are excluded because they reference tools that only exist in the parent runner.Eventobjects are created — preventsstate_deltafrom original events being replayed in the child session.thoughtparts are filtered out — internal reasoning shouldn't leak to the child.