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

Class AgentHandle

src/server/server.py:56–68  ·  view source on GitHub ↗

Handle to a spawned agent subprocess (or test double). ``send_to_agent``: write a JSON-encoded SDK message into the agent's stdin (caller adds a trailing newline if needed). ``messages_from_agent``: async iterator yielding SDK message dicts parsed from the agent's stdout. ``shut

Source from the content-addressed store, hash-verified

54
55@dataclass
56class AgentHandle:
57 """Handle to a spawned agent subprocess (or test double).
58
59 ``send_to_agent``: write a JSON-encoded SDK message into the agent's
60 stdin (caller adds a trailing newline if needed).
61 ``messages_from_agent``: async iterator yielding SDK message dicts
62 parsed from the agent's stdout.
63 ``shutdown``: terminate the agent and clean up.
64 """
65
66 send_to_agent: Callable[[dict], Awaitable[None]]
67 messages_from_agent: Callable[[], AsyncIterator[dict]]
68 shutdown: Callable[[], Awaitable[None]]
69
70
71# ─── HTTP/1.1 minimal parser for POST /sessions ────────────────────────────

Callers 2

spawnFunction · 0.90
spawnFunction · 0.90

Calls

no outgoing calls

Tested by 1

spawnFunction · 0.72