MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / execute_turn

Method execute_turn

openspace/communication/runtime_manager.py:39–63  ·  view source on GitHub ↗
(
        self,
        *,
        message: ChannelMessage,
        conversation_history: list[dict[str, str]],
        channel_context: dict[str, Any],
        max_iterations: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

37 return self._openspace
38
39 async def execute_turn(
40 self,
41 *,
42 message: ChannelMessage,
43 conversation_history: list[dict[str, str]],
44 channel_context: dict[str, Any],
45 max_iterations: Optional[int] = None,
46 ) -> Dict[str, Any]:
47 async with self._lock:
48 openspace = await self.ensure_initialized()
49 self.last_used_monotonic = monotonic()
50 task_id = f"comm_{self.session.session_key}_{uuid.uuid4().hex[:10]}"
51 result = await openspace.execute(
52 task=message.text,
53 context={
54 "conversation_history": conversation_history,
55 "channel_context": channel_context,
56 "session_key": self.session.session_key,
57 },
58 workspace_dir=self.session.workspace_dir,
59 max_iterations=max_iterations,
60 task_id=task_id,
61 )
62 self.last_used_monotonic = monotonic()
63 return result
64
65 async def close(self) -> None:
66 if self._openspace is not None:

Callers 2

execute_turnMethod · 0.45
_process_messageMethod · 0.45

Calls 2

ensure_initializedMethod · 0.95
executeMethod · 0.45

Tested by

no test coverage detected