Agents 1.6.9
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::runtime::ServiceSupervisor Class Reference

Probes /health, asks the system service manager, or spawns the binary itself. More...

#include <service_supervisor.h>

Classes

struct  Status
 Status tracked components. More...

Public Member Functions

 ServiceSupervisor (const ServiceSupervisor &)=delete
ServiceSupervisor & operator= (const ServiceSupervisor &)=delete
std::shared_ptr< ServiceHandleensure (const ComponentSpec &spec)
 Make a component reachable, or return Unavailable.
std::vector< Statussnapshot () const
 Snapshot of all tracked components.
void shutdown ()
 SIGTERM → grace → SIGKILL for owned children. Idempotent. Service-managed children are left alone.

Detailed Description

Probes /health, asks the system service manager, or spawns the binary itself.

Ownership rules:

  • If we found the component already running, we never touch it on shutdown.
  • If we asked launchd/systemd to start it, we leave the service manager in charge.
  • If we spawned the child ourselves, we SIGTERM (then SIGKILL after grace) on shutdown.

One supervisor per Hannah process. Not copyable.

Member Function Documentation

◆ ensure()

std::shared_ptr< ServiceHandle > agents::runtime::ServiceSupervisor::ensure ( const ComponentSpec & spec)

Make a component reachable, or return Unavailable.

Blocks up to spec.startup_timeout. Safe to call multiple times for the same name (returns the existing handle).

◆ snapshot()

std::vector< Status > agents::runtime::ServiceSupervisor::snapshot ( ) const

Snapshot of all tracked components.

Returns
std::vector<Status> list of status per component