|
71 | 71 | TemporalAgent, |
72 | 72 | ) |
73 | 73 | from pydantic_ai.durable_exec.temporal._function_toolset import TemporalFunctionToolset |
74 | | - from pydantic_ai.durable_exec.temporal._mcp_server import TemporalMCPServer |
75 | 74 | from pydantic_ai.durable_exec.temporal._model import TemporalModel |
76 | 75 | from pydantic_ai.durable_exec.temporal._run_context import TemporalRunContext |
77 | 76 | except ImportError: # pragma: lax no cover |
@@ -1231,32 +1230,14 @@ async def test_temporal_agent(): |
1231 | 1230 | assert isinstance(complex_temporal_agent.model, TemporalModel) |
1232 | 1231 | assert complex_temporal_agent.model.wrapped == complex_agent.model |
1233 | 1232 |
|
1234 | | - toolsets = complex_temporal_agent.toolsets |
1235 | | - assert len(toolsets) == 4 |
1236 | | - |
1237 | | - # Wrapped function toolset for the agent's own tools |
1238 | | - assert isinstance(toolsets[0], TemporalFunctionToolset) |
1239 | | - assert toolsets[0].id == '<agent>' |
1240 | | - assert isinstance(toolsets[0].wrapped, FunctionToolset) |
1241 | | - assert toolsets[0].wrapped.tools.keys() == {'get_weather'} |
1242 | | - |
1243 | | - # Wrapped 'country' toolset |
1244 | | - assert isinstance(toolsets[1], TemporalFunctionToolset) |
1245 | | - assert toolsets[1].id == 'country' |
1246 | | - assert toolsets[1].wrapped == complex_agent.toolsets[1] |
1247 | | - assert isinstance(toolsets[1].wrapped, FunctionToolset) |
1248 | | - assert toolsets[1].wrapped.tools.keys() == {'get_country'} |
1249 | | - |
1250 | | - # Wrapped 'mcp' MCP server |
1251 | | - assert isinstance(toolsets[2], TemporalMCPServer) |
1252 | | - assert toolsets[2].id == 'mcp' |
1253 | | - assert toolsets[2].wrapped == complex_agent.toolsets[2] |
1254 | | - |
1255 | | - # Unwrapped 'external' toolset |
1256 | | - assert isinstance(toolsets[3], ExternalToolset) |
1257 | | - assert toolsets[3].id == 'external' |
1258 | | - assert toolsets[3] == complex_agent.toolsets[3] |
| 1233 | + # Toolsets should match the wrapped agent's toolsets |
| 1234 | + assert len(complex_temporal_agent.toolsets) == 4 |
| 1235 | + assert complex_temporal_agent.toolsets[0].id == '<agent>' |
| 1236 | + assert complex_temporal_agent.toolsets[1].id == 'country' |
| 1237 | + assert complex_temporal_agent.toolsets[2].id == 'mcp' |
| 1238 | + assert complex_temporal_agent.toolsets[3].id == 'external' |
1259 | 1239 |
|
| 1240 | + # Temporal activities verify that toolsets are properly wrapped for workflow execution |
1260 | 1241 | assert [ |
1261 | 1242 | ActivityDefinition.must_from_callable(activity).name # pyright: ignore[reportUnknownMemberType] |
1262 | 1243 | for activity in complex_temporal_agent.temporal_activities |
|
0 commit comments