Finish agentd migration to Omni/Agent

t-775·WorkTask·
·
·
Created1 week ago·Updated1 week ago·pipeline runs →

Description

Edit

Agentd services still invoke pi via ~/.local/bin/agentd-rpc. Migrate service/runtime wiring to use Omni/Agent.hs directly and remove dependence on ~/.local artifacts, ensuring configuration is declared and tracked in omnirepo.

Git Commits

4427e278agentd: deploy hermetically via deployer
Coder Agent8 days ago4 files

Timeline (12)

🔄[human]Open → InProgress1 week ago
💬[human]1 week ago

Implemented persistent agent runtime migration in Omni/Agentd/Daemon.hs: agentd now generates tracked systemd/runtime assets under ~/.config (agentd-agent@.service + agentd-agent-exec), writes AGENTD_AGENT_COMMAND into env files, and no longer depends on ~/.local/bin wrappers or agentd-rpc defaults. Updated FIFO send framing to NUL-delimited prompts for Omni/Agent stdin mode. create/start/restart now ensure assets + rewrite env files before daemon-reload. Added unit tests covering script/unit templates and legacy rpc-path absence; docs updated in Omni/Agentd/SPEC.md. Verified with typecheck.sh Omni/Agentd/Daemon.hs, typecheck.sh Omni/Agentd.hs, bild Omni/Agentd/Daemon.hs, bild --test Omni/Agentd/Daemon.hs, bild Omni/Agentd.hs, bild --test Omni/Agentd.hs. Applied local migration by restarting existing agentd-agent@ services; confirmed all MainPID commands are /home/ben/omni/live/_/bin/agent ... --json (not pi).

🔄[human]InProgress → Review1 week ago
🔄[human]Review → InProgress1 week ago
💬[human]1 week ago

Follow-up migration complete: switched live agentd deployment to deployer-managed hermetic config and removed pi-path/local-home runtime defaults. Updated manifest service 'agentd' to run /nix/store/...-agentd/bin/agentd with command: agentd daemon --db /var/lib/omni/agentd.db --log-root /var/log/agentd --workspace /var/lib/omni/agentd/workspaces (no --pi-path, no ~/.local db/log paths). Added AGENTD_AGENT_COMMAND=/nix/store/...-agent/bin/agent to manifest env so persistent units resolve agent via absolute Nix store path. Added repo-tracked deploy script Omni/Ide/deploy-agentd.sh to reproducibly apply this manifest shape via deploy-manifest add-service. In code, Omni/Agentd/Daemon.hs now generates persistent user unit/exec assets under ~/.config, writes AGENTD_AGENT_COMMAND into env files, and sends prompts via NUL framing. Verified active processes now run /nix/store/...-agent/bin/agent (not /home/.../_/bin/agent, not pi). Also documented in Omni/Agentd/SPEC.md and Omni/Deploy/README.md.

💬[human]1 week ago

Discovered follow-up bug while validating HTTP send after daemon restart: existing persistent agents are not addressable via /agents/<id>/send until re-created under current daemon process. Filed as t-776.

🔄[human]InProgress → Review1 week ago
💬[human]1 week ago

Committed 4427e278: deployer-managed hermetic agentd migration. Includes Omni/Agentd/Daemon.hs runtime asset generation + AGENTD_AGENT_COMMAND/AGENTD_STATE_DIR wiring, NUL FIFO framing, persistent send/stop fallback after daemon restart, docs updates, and canonical deploy script Omni/Ide/deploy-agentd.sh.