mirror of
https://github.com/hanzoai/agent.git
synced 2026-09-11 21:08:51 +00:00
Closes the Hanzo-side LP-201 Tier 1 control-plane migration step. ZapClient
+ ZapAgent + consensus primitives already shipped in src/agents/zap/; this
landing wires the AgentNetwork-side cross-process lookup path.
New: agents/network/remote.py
- RemoteAgentProxy: value-shaped facade quacking like Agent on the routing
side (name + handoff_description) and dispatching invocations through
ZapClient.call_tool(`agent/<name>`, …) on the wire side.
- is_zap_wire_enabled(): single source of truth for the feature flag —
one function, one place (Hickey-style profile gate). Reads HANZO_AGENT_WIRE
case-insensitively; only the literal "zap" enables. Anything else
fail-closed (json, "true", "1", unset → JSON/local-agent path).
AgentNetwork.add_remote_agent(name, zap_uri, …): cross-process counterpart
of add_agent. Holds a NetworkNode pointing at a RemoteAgentProxy; the router
reads it like a local agent (same capabilities/metadata surface). At
dispatch the proxy's invoke() pushes over the ZAP wire — and raises with a
clear message if the operator forgot to set the env var.
Default path (no env) keeps the JSON/OpenAI-compatible wire — external API
consumers see no change. ZAP is intra-cluster only.
Tests: 7 unit tests covering both feature-flag combinations + the clone()
mirror + the fail-loud guard, all green via --noconftest (existing conftest
pulls heavy deps; tests load remote.py directly via importlib, mirroring
test_zap.py).