MCPcopy
hub / github.com/aiming-lab/MetaClaw / wait_for_proxy

Function wait_for_proxy

scripts/run_memory_ablation.py:156–169  ·  view source on GitHub ↗
(timeout_s=90)

Source from the content-addressed store, hash-verified

154# Proxy helpers #
155# ------------------------------------------------------------------ #
156async def wait_for_proxy(timeout_s=90):
157 url = f"http://127.0.0.1:{PROXY_PORT}/docs"
158 start = time.monotonic()
159 while True:
160 try:
161 async with httpx.AsyncClient(timeout=3.0) as client:
162 resp = await client.get(url)
163 if resp.status_code < 500:
164 return
165 except Exception:
166 pass
167 if time.monotonic() - start > timeout_s:
168 raise TimeoutError("Proxy did not start in time")
169 await asyncio.sleep(1.0)
170
171
172async def send_chat(messages, session_id, session_done=False, retries=3):

Callers 1

run_conditionFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected