MCPcopy
hub / github.com/dataelement/Clawith / _route_openclaw

Method _route_openclaw

backend/app/api/websocket.py:656–677  ·  view source on GitHub ↗

Enqueues message for OpenClaw edge node poll.

(self, content: str)

Source from the content-addressed store, hash-verified

654 logger.info("[WS] User message saved")
655
656 async def _route_openclaw(self, content: str):
657 """Enqueues message for OpenClaw edge node poll."""
658 from app.models.gateway_message import GatewayMessage as GwMsg
659
660 async with async_session() as db:
661 gw_msg = GwMsg(
662 agent_id=self.agent_id,
663 sender_user_id=self.user.id,
664 conversation_id=self.conv_id,
665 content=content,
666 status="pending",
667 )
668 db.add(gw_msg)
669 await db.commit()
670 logger.info("[WS] OpenClaw: message queued for gateway poll")
671 await self.websocket.send_json(
672 {
673 "type": "done",
674 "role": "assistant",
675 "content": "Message forwarded to OpenClaw agent. Waiting for response...",
676 }
677 )
678
679 async def _run_llm_and_stream(
680 self, effective_llm_model: LLMModel, is_onboarding_trigger: bool

Callers 1

message_loopMethod · 0.95

Calls 2

addMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected