MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _work

Method _work

src/server/agent_server.py:712–722  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

710 text = "\n".join(f"{getattr(m, 'role', '?')}: {self._message_text(m)[:400]}" for m in msgs[-12:])
711
712 def _work() -> None:
713 try:
714 prompt = (
715 "Analyze this coding session and give 3-5 concise insights: what was "
716 "accomplished, notable patterns, and one suggestion for next steps. "
717 "Be brief — short bullet points.\n\nSESSION:\n" + text
718 )
719 resp = self.provider.chat([{"role": "user", "content": prompt}])
720 self._reply(request_id, {"ok": True, "insights": (getattr(resp, "content", "") or "").strip()})
721 except Exception as exc: # noqa: BLE001
722 self._reply(request_id, {"ok": False, "error": str(exc)})
723
724 threading.Thread(target=_work, name=f"insights-{self.session_id}", daemon=True).start()
725

Callers

nothing calls this directly

Calls 2

_replyMethod · 0.95
chatMethod · 0.45

Tested by

no test coverage detected