@@ -1118,6 +1118,11 @@ def simple_test_tool(message: str) -> str:
11181118 available_tools [0 ].update (
11191119 {"tool_input_guardrails" : None , "tool_output_guardrails" : None }
11201120 )
1121+ if parse_version (OPENAI_AGENTS_VERSION ) >= (
1122+ 0 ,
1123+ 8 ,
1124+ ):
1125+ available_tools [0 ]["needs_approval" ] = False
11211126
11221127 available_tools = safe_serialize (available_tools )
11231128
@@ -1496,6 +1501,7 @@ async def test_error_handling(sentry_init, capture_events, test_agent):
14961501 )
14971502
14981503 (
1504+ error_log ,
14991505 error_event ,
15001506 transaction ,
15011507 ) = events
@@ -1545,6 +1551,7 @@ async def test_error_captures_input_data(sentry_init, capture_events, test_agent
15451551 )
15461552
15471553 (
1554+ error_log ,
15481555 error_event ,
15491556 transaction ,
15501557 ) = events
@@ -1588,7 +1595,7 @@ async def test_span_status_error(sentry_init, capture_events, test_agent):
15881595 test_agent , "Test input" , run_config = test_run_config
15891596 )
15901597
1591- (error , transaction ) = events
1598+ (error_log , error , transaction ) = events
15921599 assert error ["level" ] == "error"
15931600 assert transaction ["spans" ][0 ]["status" ] == "internal_error"
15941601 assert transaction ["spans" ][0 ]["tags" ]["status" ] == "internal_error"
@@ -2692,27 +2699,6 @@ def test_openai_agents_message_truncation(sentry_init, capture_events):
26922699 assert "small message 5" in str (parsed_messages [0 ])
26932700
26942701
2695- def test_streaming_patches_applied (sentry_init ):
2696- """
2697- Test that the streaming patches are applied correctly.
2698- """
2699- sentry_init (
2700- integrations = [OpenAIAgentsIntegration ()],
2701- traces_sample_rate = 1.0 ,
2702- )
2703-
2704- # Verify that run_streamed is patched (will have __wrapped__ attribute if patched)
2705- import agents
2706-
2707- # Check that the method exists and has been modified
2708- assert hasattr (agents .run .DEFAULT_AGENT_RUNNER , "run_streamed" )
2709- assert hasattr (agents .run .AgentRunner , "_run_single_turn_streamed" )
2710-
2711- # Verify the patches were applied by checking for our wrapper
2712- run_streamed_func = agents .run .DEFAULT_AGENT_RUNNER .run_streamed
2713- assert run_streamed_func is not None
2714-
2715-
27162702@pytest .mark .asyncio
27172703async def test_streaming_span_update_captures_response_data (
27182704 sentry_init , test_agent , mock_usage
0 commit comments