@@ -192,8 +192,8 @@ def __init__(
192192 Args:
193193 app: An `App` instance. Mutually exclusive with `agent` and `node`.
194194 app_name: The application name. Required when `agent` is provided.
195- Optional override for `app.name` when `app` is provided. Defaults
196- to `node.name` when only `node` is provided.
195+ Optional override for `app.name` when `app` is provided. Defaults to
196+ `node.name` when only `node` is provided.
197197 agent: The root agent to run. Mutually exclusive with `app` and `node`.
198198 node: The root node to run. Mutually exclusive with `app` and `agent`.
199199 plugins: Deprecated. A list of plugins for the runner. Please use the
@@ -203,8 +203,8 @@ def __init__(
203203 memory_service: The memory service for the runner.
204204 credential_service: The credential service for the runner.
205205 plugin_close_timeout: The timeout in seconds for plugin close methods.
206- auto_create_session: Whether to automatically create a session when
207- not found. Defaults to False. If False, a missing session raises
206+ auto_create_session: Whether to automatically create a session when not
207+ found. Defaults to False. If False, a missing session raises
208208 ValueError with a helpful message.
209209
210210 Raises:
@@ -1071,6 +1071,7 @@ async def _run_with_trace(
10711071 new_message = new_message ,
10721072 run_config = run_config ,
10731073 state_delta = state_delta ,
1074+ invocation_id = invocation_id ,
10741075 )
10751076 else :
10761077 invocation_id = self ._resolve_invocation_id (
@@ -1833,6 +1834,7 @@ async def _setup_context_for_new_invocation(
18331834 new_message : types .Content ,
18341835 run_config : RunConfig ,
18351836 state_delta : Optional [dict [str , Any ]],
1837+ invocation_id : Optional [str ] = None ,
18361838 ) -> InvocationContext :
18371839 """Sets up the context for a new invocation.
18381840
@@ -1841,6 +1843,7 @@ async def _setup_context_for_new_invocation(
18411843 new_message: The new message to process and append to the session.
18421844 run_config: The run config of the agent.
18431845 state_delta: Optional state changes to apply to the session.
1846+ invocation_id: Optional invocation identifier.
18441847
18451848 Returns:
18461849 The invocation context for the new invocation.
@@ -1850,6 +1853,7 @@ async def _setup_context_for_new_invocation(
18501853 session ,
18511854 new_message = new_message ,
18521855 run_config = run_config ,
1856+ invocation_id = invocation_id ,
18531857 )
18541858 # Step 2: Handle new message, by running callbacks and appending to
18551859 # session.
0 commit comments