Skip to content

Commit 009e3b8

Browse files
authored
Merge pull request #8 from reward-protocol/derekx/execution-manager
Flatten Rollout Manager and Session Manager into an Execution Manager
2 parents 89d0114 + 9994141 commit 009e3b8

8 files changed

Lines changed: 468 additions & 82 deletions

File tree

examples/rollout_control_plane_demo.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
# Add the mcp directory to path
2323
sys.path.insert(0, str(Path(__file__).parent.parent))
2424

25-
from reward_protocol.mcp.execution.rollout import RolloutManager
26-
from reward_protocol.mcp.session.manager import GeneralMCPVectorEnv, SessionManager
27-
from reward_protocol.mcp.types import DatasetRow, MCPSession, MCPToolCall, Trajectory
25+
from reward_kit.mcp.execution.manager import ExecutionManager
26+
from reward_kit.mcp.session.manager import GeneralMCPVectorEnv
27+
from reward_kit.mcp.types import DatasetRow, MCPSession, MCPToolCall, Trajectory
2828

2929

3030
class DemoPolicy:
@@ -93,8 +93,7 @@ async def demonstrate_control_plane_rollout():
9393
]
9494

9595
# Create rollout manager
96-
session_manager = SessionManager()
97-
rollout_manager = RolloutManager(session_manager)
96+
execution_manager = ExecutionManager()
9897

9998
# Mock the vector environment to simulate control plane separation
10099
with patch.object(GeneralMCPVectorEnv, "__init__", return_value=None), patch.object(
@@ -274,7 +273,7 @@ def mock_step_side_effect(tool_calls):
274273
print()
275274

276275
# Execute rollout
277-
trajectories = await rollout_manager.execute_rollout(mock_env, policy, steps=10)
276+
trajectories = await execution_manager.execute_rollout(mock_env, policy, steps=10)
278277

279278
print()
280279
print("📋 ROLLOUT RESULTS")
@@ -378,4 +377,4 @@ def mock_step_side_effect(tool_calls):
378377

379378

380379
if __name__ == "__main__":
381-
asyncio.run(demonstrate_control_plane_rollout())
380+
asyncio.run(demonstrate_control_plane_rollout())

reward_kit/mcp/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
# New refactored components
1313
from .client import MCPConnectionManager
14-
from .execution import FireworksPolicy, LLMBasePolicy, RolloutManager
14+
from .execution import FireworksPolicy, LLMBasePolicy, ExecutionManager
1515
from .gym_production_server import GymProductionServer
1616

1717
# North Star MCP-Gym Framework
1818
from .mcpgym import McpGym
1919
from .server import MCPEnvironmentServer
20-
from .session import GeneralMCPVectorEnv, SessionManager
20+
from .session import GeneralMCPVectorEnv
2121
from .simulation_server import SimulationServerBase
2222
from .types import DatasetRow, MCPSession, MCPToolCall, Trajectory
2323

@@ -31,13 +31,12 @@
3131
"MCPConnectionManager",
3232
"LLMBasePolicy",
3333
"FireworksPolicy",
34-
"RolloutManager",
35-
"SessionManager",
34+
"ExecutionManager",
3635
"GeneralMCPVectorEnv",
3736
"MCPSession",
3837
"MCPToolCall",
3938
"DatasetRow",
4039
"Trajectory",
4140
# North Star MCP-Gym Framework
4241
"McpGym",
43-
]
42+
]

reward_kit/mcp/execution/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"""
66

77
from .policy import FireworksPolicy, LLMBasePolicy
8-
from .rollout import RolloutManager
8+
from .manager import ExecutionManager
99

1010
__all__ = [
1111
"LLMBasePolicy",
1212
"FireworksPolicy",
13-
"RolloutManager",
14-
]
13+
"ExecutionManager",
14+
]

0 commit comments

Comments
 (0)