feat(daemon): zot-rpc spawn driver + binary-aware autospawn args (#143) #157
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "zot-rpc-spawn-driver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the colibri#143 zot-rpc driver (Path B) so zot can be a real, board-integrated OOTB autospawn agent.
Problem
The spawner spawned every agent with
stdin(Stdio::null())and read stdout only — it could only host self-driving emitters (pi --mode json). But zot's only structured persistent mode iszot rpc, a request/response peer that blocks on stdin, so it could never autospawn (confirmed against the v0.2.42 source:--print/--jsonare one-shot,--rpcneeds stdin, and there is no--modeflag). 0.12.0 made this worse by defaultingCOLIBRI_AUTOSPAWN_BINARY=zotwhile args defaulted to--mode json— invalid for zot → OOTB spawns a broken/no agent.Change
AgentSpawnConfig.rpc_stdin— when set, the spawner pipes stdin and keeps the writer; otherwise stdin stays null (pi path unchanged).cmd_spawn_agentauto-detects rpc mode from argv (rpc/--rpc).AgentHandle→ cloneableRpcSender(Arc-backed) so prompts are written without holding the agent-registry (DashMap) lock across the async write.build_rpc_promptemits zot's exact wire format{"id","type":"prompt","message"}(matchesdocs/ZOT-RPC-TRANSCRIPT.md).rpc, pi →--mode json(fixes the invalid default). Optional one-time bootstrap prompt viaCOLIBRI_AUTOSPAWN_RPC_PROMPT(default boot spends no tokens). Log strings de-pi-fied.Tests
rpc_stdindefault false, sender presence by mode.zot rpcsmoke pending — the build host couldn't fetch Go modules in this session; the request shape is byte-identical to the recorded real-key transcript.Scope / follow-ups
This lands the spawn-side driver + ready rpc peer. Routing board tasks to an rpc agent's stdin (via
RpcSender) is the next increment. zot now comes up correctly under autospawn instead of crashing on--mode json.🤖 Generated with Claude Code
The spawner spawned every agent with stdin(Stdio::null()) and read stdout only, so it could only host self-driving emitters (pi --mode json). zot's only structured persistent mode is `zot rpc`, which is a request/response peer that blocks on stdin — so it could never autospawn. Worse, 0.12.0 defaulted COLIBRI_AUTOSPAWN_BINARY=zot while args defaulted to --mode json, which is not a zot flag, so the OOTB image would spawn a broken/no agent. Add a stdin RPC driver: - AgentSpawnConfig.rpc_stdin: when set, the spawner pipes stdin and keeps the writer; otherwise stdin stays null (unchanged path for pi). - cmd_spawn_agent auto-detects rpc mode from argv (`rpc`/`--rpc`). - AgentHandle gains a cloneable RpcSender (Arc-backed) so prompts can be sent without holding the agent-registry lock across the async write. build_rpc_prompt emits zot's wire format: {"id","type":"prompt","message"}. - Autospawn picks default argv per harness: zot -> `rpc`, pi -> `--mode json` (corrects the invalid --mode-json-for-zot default), and optionally sends a one-time bootstrap prompt when COLIBRI_AUTOSPAWN_RPC_PROMPT is set (default boot spends no tokens). Log strings de-pi-fied (autospawn-pi -> autospawn). Tests: build_rpc_prompt framing + escaping, rpc_stdin default, sender presence by mode. Full workspace: 250 tests, 0 failures. Live zot rpc smoke pending (wire format matches docs/ZOT-RPC-TRANSCRIPT.md real-key capture). Stacks on the 0.12.0 compile/lock fix (PR #156). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>