@@ -157,8 +157,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
157157 if agent and agent .on_agent_step_start :
158158 hook_context = HookContext (
159159 workflow_id = ctx .agent_id ,
160- agent_workflow_id = ctx .agent_id ,
161- agent_run_id = agent_run_id ,
162160 session_id = ctx .session_id ,
163161 user_id = ctx .user_id ,
164162 agent_config = agent_config ,
@@ -173,8 +171,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
173171 )
174172
175173 # Apply modifications
176- if hook_result .modified_agent_config :
177- agent_config .update (hook_result .modified_agent_config )
178174 if hook_result .modified_payload and "messages" in hook_result .modified_payload :
179175 conversation_messages = hook_result .modified_payload ["messages" ]
180176
@@ -284,8 +280,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
284280 if agent and agent .on_tool_start :
285281 hook_context = HookContext (
286282 workflow_id = ctx .agent_id ,
287- agent_workflow_id = ctx .agent_id ,
288- agent_run_id = agent_run_id ,
289283 session_id = ctx .session_id ,
290284 user_id = ctx .user_id ,
291285 agent_config = agent_config ,
@@ -298,8 +292,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
298292 )
299293
300294 # Apply modifications
301- if hook_result .modified_agent_config :
302- agent_config .update (hook_result .modified_agent_config )
303295 if hook_result .modified_payload :
304296 tool_args .update (hook_result .modified_payload )
305297
@@ -353,8 +345,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
353345 if agent and agent .on_tool_end :
354346 hook_context = HookContext (
355347 workflow_id = ctx .agent_id ,
356- agent_workflow_id = ctx .agent_id ,
357- agent_run_id = agent_run_id ,
358348 session_id = ctx .session_id ,
359349 user_id = ctx .user_id ,
360350 agent_config = agent_config ,
@@ -368,8 +358,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
368358 )
369359
370360 # Apply modifications
371- if hook_result .modified_agent_config :
372- agent_config .update (hook_result .modified_agent_config )
373361 if hook_result .modified_output is not None :
374362 tool_result = hook_result .modified_output
375363
@@ -442,8 +430,6 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
442430 if agent and agent .on_agent_step_end :
443431 hook_context = HookContext (
444432 workflow_id = ctx .agent_id ,
445- agent_workflow_id = ctx .agent_id ,
446- agent_run_id = agent_run_id ,
447433 session_id = ctx .session_id ,
448434 user_id = ctx .user_id ,
449435 agent_config = agent_config ,
@@ -456,11 +442,9 @@ async def _agent_stream_function(ctx: AgentContext, payload: dict[str, Any]) ->
456442 )
457443
458444 # Apply modifications
459- if hook_result .modified_agent_config :
460- agent_config .update (hook_result .modified_agent_config )
461445 if hook_result .modified_output :
462446 new_result = hook_result .modified_output
463- steps [- 1 ]. update ( new_result )
447+ steps [- 1 ] = new_result
464448
465449 # Check hook action
466450 if hook_result .action == HookAction .FAIL :
0 commit comments