docs: clarify agent tool state options#3754
Conversation
seratch
left a comment
There was a problem hiding this comment.
Thanks for adding this clarification. The state options do configure the nested Runner invocation and are not inherited automatically from the parent run.
However, the current statement that they "are not shared" is too absolute. Passing the same Session to the parent run and agent.as_tool(...) is an intentional supported workflow; #1550 added per-turn persistence specifically for this agent-as-tool use case.
Please revise the paragraph to say that parent conversation state is not inherited automatically, while noting that callers can explicitly pass the same session when shared client-managed history is desired. The guidance to avoid mixing client-managed sessions with server-managed continuation should remain.
What
Clarify that
agent.as_tool()state options such assession,previous_response_id, andconversation_idapply to the nested agent run started by the tool call.Why
This avoids confusion about whether nested tool-agent state is shared with the parent run, and points readers back to the same state-management choices used with
Runner.run.Test
git diff --checkdocs/tools.mdcontains the new note and keeps the structured-input sentence.