Skip to content

API Reference parrot.integrations.agentd.service

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.integrations.agentd.service

View source

AgentDaemon — lifecycle, RPC handlers, sd_notify.

Implements Module 5 of sdd/specs/agent-cli-daemon.spec.md: the daemon itself. Binds one agent (resolve_agent(), TASK-2210) + an optional headless scheduler (AgentSchedulerManager.start_headless(), TASK-2209, lazily imported from ai-parrot-server) + the UDS server (JsonRpcUnixServer, TASK-2211) into one foreground process implementing the full RPC surface and the 6-step lifecycle of spec §2 "Daemon lifecycle".

Class AgentDaemon

Foreground per-agent daemon (spec §2 "Daemon lifecycle").

Loads exactly one agent, optionally boots AgentSchedulerManager headless (best-effort -- degrades with a warning if ai-parrot-server is not installed), and serves JSON-RPC 2.0 over a Unix domain socket until a shutdown signal (or daemon.shutdown RPC) is received.

Parameter Type Default Description
config AgentServiceConfig

Attributes:

Attribute Type Description
config The daemon's AgentServiceConfig.
agent Any The resolved agent instance (set once run() starts).
server JsonRpcUnixServer | None The JsonRpcUnixServer instance (set once run() starts).

Method AgentDaemon.run

Run the daemon's full lifecycle (spec §2, steps 1-6).

Returns once a graceful shutdown completes (SIGTERM/SIGINT or a daemon.shutdown RPC).

run() -> None

Function sd_notify

Send a systemd sd_notify datagram, if NOTIFY_SOCKET is set.

Hand-rolled (no dependency on the sdnotify PyPI package, per spec §7). No-op when NOTIFY_SOCKET is unset (e.g. Type=simple / supervisord, or a plain terminal run).

sd_notify(state: str) -> None

Parameter Type Default Description
state str The state string to send (e.g. "READY=1", "STOPPING=1").

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally