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

Method _run_worker

src/server/agent_server.py:1122–1133  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1120 self._worker.start()
1121
1122 def _run_worker(self) -> None:
1123 while not self._stop.is_set():
1124 item = self._inbox.get()
1125 if item is _SHUTDOWN or self._stop.is_set():
1126 break
1127 if isinstance(item, dict) and item.get("__btw__"): # side question (/btw)
1128 self._run_turn(item.get("content"), btw=True)
1129 continue
1130 if not isinstance(item, (str, list)): # str prompt, or multimodal blocks
1131 continue
1132 self._run_turn(item)
1133 self._close_stream()
1134
1135 def _run_turn(self, prompt, btw: bool = False) -> None: # prompt: str | list[ContentBlock]
1136 # btw=True → a "side question" (the original's /btw): run with full context

Callers

nothing calls this directly

Calls 3

_run_turnMethod · 0.95
_close_streamMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected