(
self,
*,
message: ChannelMessage,
conversation_history: list[dict[str, str]],
channel_context: dict[str, Any],
max_iterations: Optional[int] = None,
)
| 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: |
no test coverage detected