Add run-scoped skill and prompt asset management
This commit is contained in:
@@ -219,6 +219,8 @@ class Gateway:
|
||||
await self._send_initial_state(websocket)
|
||||
elif msg_type == "start_backtest":
|
||||
await self._handle_start_backtest(data)
|
||||
elif msg_type == "reload_runtime_assets":
|
||||
await self._handle_reload_runtime_assets()
|
||||
|
||||
except websockets.ConnectionClosed:
|
||||
pass
|
||||
@@ -236,6 +238,19 @@ class Gateway:
|
||||
task.add_done_callback(self._handle_backtest_exception)
|
||||
self._backtest_task = task
|
||||
|
||||
async def _handle_reload_runtime_assets(self):
|
||||
"""Reload prompt assets and active skills without restarting the server."""
|
||||
result = self.pipeline.reload_runtime_assets()
|
||||
await self.state_sync.on_system_message(
|
||||
"Runtime assets reloaded.",
|
||||
)
|
||||
await self.broadcast(
|
||||
{
|
||||
"type": "runtime_assets_reloaded",
|
||||
**result,
|
||||
},
|
||||
)
|
||||
|
||||
async def broadcast(self, message: Dict[str, Any]):
|
||||
"""Broadcast message to all connected clients"""
|
||||
if not self.connected_clients:
|
||||
|
||||
Reference in New Issue
Block a user