MCPcopy
hub / github.com/langchain-ai/deepagents / _safe_drain

Method _safe_drain

libs/code/deepagents_code/app.py:3893–3904  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3891 if self._deferred_actions and not self._agent_running:
3892
3893 async def _safe_drain() -> None:
3894 try:
3895 await self._maybe_drain_deferred()
3896 except Exception:
3897 logger.exception("Unhandled error while draining deferred actions")
3898 with suppress(Exception):
3899 await self._mount_message(
3900 ErrorMessage(
3901 "A deferred action failed during startup. "
3902 "You may need to retry the operation.",
3903 ),
3904 )
3905
3906 self.call_after_refresh(lambda: asyncio.create_task(_safe_drain()))
3907

Callers

nothing calls this directly

Calls 3

_maybe_drain_deferredMethod · 0.95
_mount_messageMethod · 0.95
ErrorMessageClass · 0.90

Tested by

no test coverage detected