Replace pi --mode rpc with agent (no args, stdin-mode) as the persistent agent runner in Omni/Agentd/Daemon.hs. This unifies persistent and one-shot runs under a single binary and gives persistent agents access to agentd's replay/debug tooling.
Omni/Agentd/Daemon.hs spawns persistent agents as pi --mode rpc, holds the stdin/stdout pipes in an in-memory RunningAgent map, and parses pi's bespoke JSONL schema from stdout.
agent (via whatever path lookup already exists for oneshot runs) with no script argument, so it enters stdin-prompt mode.hPutStr stdin promptText >> hPutChar stdin '\NUL' >> hFlush stdin.signalProcess sigINT agentPid (no stdin message).sigTERM.Trace.Event JSONL — which is the same format the oneshot path already parses, so this should share code with the existing oneshot event reader.POST /agents) spawns agent (not pi) and the agent accepts prompts via null-delimited stdin writes.POST /agents/<id>/send successfully delivers a prompt and the agent responds.POST /agents/<id>/stop cleanly terminates the agent.agentd replay <run-id> and agentd debug <run-id> both work for persistent agents — same as they already do for oneshot, because they read Trace.Event from the same event log.t-759.1 (stdin mode) and t-759.2 (signal handling) must land first.
Omni/Agentd/Daemon.hs — main spawn code and stdin/stdout handling for RunningAgent
Implemented pi->agent swap for daemon-managed persistent runner in Omni/Agentd/Daemon.hs. Spawner now launches agent in stdin mode (no prompt arg) with --provider/--model/--json. Prompt delivery uses NUL framing (hPutStr + hPutChar '\NUL' + hFlush). Stop path now sends SIGTERM and closes stdin for graceful exit. Output reader now parses Trace.Event JSONL and updates running/idle state, summary, and cost from Trace events. HTTP handlers /agents, /agents/:id/send, /agents/:id/stop now use the in-process runner map so POST flows hit the new agent runner directly. Updated mock runner script in tests to emit Trace.Event JSON and read NUL-delimited prompts. Verified with typecheck.sh Omni/Agentd/Daemon.hs, bild Omni/Agentd/Daemon.hs, bild --test Omni/Agentd/Daemon.hs.