MCPcopy
hub / github.com/AstrBotDevs/AstrBot / stop_session

Method stop_session

astrbot/dashboard/services/chat_service.py:990–999  ·  view source on GitHub ↗
(self, username: str, session_id: str)

Source from the content-addressed store, hash-verified

988 return stream()
989
990 async def stop_session(self, username: str, session_id: str) -> dict:
991 session = await self.db.get_platform_session_by_id(session_id)
992 if not session:
993 raise ChatServiceError(f"Session {session_id} not found")
994 if session.creator != username:
995 raise ChatServiceError("Permission denied")
996
997 unified_msg_origin = build_webchat_unified_msg_origin(session)
998 stopped_count = active_event_registry.request_agent_stop_all(unified_msg_origin)
999 return {"stopped_count": stopped_count}
1000
1001 async def stop_session_from_dashboard_payload(
1002 self,

Callers 2

stop_chat_sessionFunction · 0.80

Calls 4

ChatServiceErrorClass · 0.85

Tested by

no test coverage detected