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

Function _elicit

src/server/agent_server.py:1364–1384  ·  view source on GitHub ↗
(params: dict[str, Any])

Source from the content-addressed store, hash-verified

1362 """
1363
1364 async def _elicit(params: dict[str, Any]) -> dict[str, Any]:
1365 request_id = str(_uuid.uuid4())
1366 pending = _Pending(event=threading.Event())
1367 with sess._lock:
1368 sess._pending[request_id] = pending
1369 sess._emit({
1370 "type": "control_request",
1371 "request_id": request_id,
1372 "request": {"subtype": "mcp_elicitation", "params": params},
1373 })
1374 loop = asyncio.get_event_loop()
1375 try:
1376 got = await loop.run_in_executor(
1377 None, pending.event.wait, sess.config.permission_timeout_s
1378 )
1379 finally:
1380 with sess._lock:
1381 sess._pending.pop(request_id, None)
1382 if not got:
1383 return {"action": "cancel"}
1384 return pending.reply or {"action": "decline"}
1385
1386 return _elicit
1387

Callers

nothing calls this directly

Calls 2

_PendingClass · 0.85
_emitMethod · 0.80

Tested by

no test coverage detected