Skip to content

Commit 32a2d1e

Browse files
committed
fix(steering): update integration tests to use plugins parameter
Update all integration tests in tests_integ/steering/ to use plugins=[handler] instead of hooks=[handler] since SteeringHandler now implements Plugin protocol instead of HookProvider.
1 parent 1f75860 commit 32a2d1e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests_integ/steering/test_model_steering.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async def steer_after_model(
3939
def test_model_steering_proceeds_without_intervention():
4040
"""Test that model steering can accept responses without modification."""
4141
handler = SimpleModelSteeringHandler(should_guide=False)
42-
agent = Agent(hooks=[handler])
42+
agent = Agent(plugins=[handler])
4343

4444
response = agent("What is 2+2?")
4545

@@ -54,7 +54,7 @@ def test_model_steering_proceeds_without_intervention():
5454
def test_model_steering_guide_triggers_retry():
5555
"""Test that Guide action triggers model retry."""
5656
handler = SimpleModelSteeringHandler(should_guide=True, guidance_message="Please provide a more detailed response.")
57-
agent = Agent(hooks=[handler])
57+
agent = Agent(plugins=[handler])
5858

5959
response = agent("What is the capital of France?")
6060

@@ -85,7 +85,7 @@ async def steer_after_model(
8585
return Proceed(reason="Response is good now")
8686

8787
handler = SpecificGuidanceHandler()
88-
agent = Agent(hooks=[handler])
88+
agent = Agent(plugins=[handler])
8989

9090
response = agent("What is the capital of France?")
9191

@@ -122,7 +122,7 @@ async def steer_after_model(
122122
return Proceed(reason="Response is good now")
123123

124124
handler = MultiRetryHandler()
125-
agent = Agent(hooks=[handler])
125+
agent = Agent(plugins=[handler])
126126

127127
response = agent("Explain machine learning.")
128128

@@ -195,7 +195,7 @@ async def steer_after_model(
195195
return Proceed(reason="Guidance was provided")
196196

197197
handler = ForceToolUsageHandler(required_tool="log_activity")
198-
agent = Agent(tools=[log_activity], hooks=[handler])
198+
agent = Agent(tools=[log_activity], plugins=[handler])
199199

200200
# Ask a question that clearly doesn't need the logging tool
201201
response = agent("What is 2 + 2?")

tests_integ/steering/test_tool_steering.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_agent_with_tool_steering_e2e():
8787
context_providers=[], # Disable ledger to avoid confusing context
8888
)
8989

90-
agent = Agent(tools=[send_email, send_notification], hooks=[handler])
90+
agent = Agent(tools=[send_email, send_notification], plugins=[handler])
9191

9292
# This should trigger steering guidance to use send_notification instead
9393
response = agent("Send an email to john@example.com saying hello")
@@ -132,7 +132,7 @@ async def steer_before_tool(self, *, agent, tool_use, **kwargs):
132132
return Proceed(reason="Ledger verified")
133133

134134
handler = LedgerCheckingHandler()
135-
agent = Agent(tools=[send_notification], hooks=[handler])
135+
agent = Agent(tools=[send_notification], plugins=[handler])
136136

137137
agent("Send a notification to alice saying test message")
138138

0 commit comments

Comments
 (0)