Skip to content

feat(orchestrator): Agent lifecycle management in reconciliation loop #636

@AlexMikhalev

Description

@AlexMikhalev

Summary

Wire reconciliation loop with agent lifecycle management:

  • Periodic tick (30s default, configurable) in select! loop
  • Agent exit detection via try_wait()
  • Safety agent auto-restart with cooldown (60s default) and max-restart cap (10 default)
  • Cron schedule checking for Core agents
  • Output event draining to nightwatch for drift detection
  • Periodic nightwatch.evaluate() calls

Config additions

  • restart_cooldown_secs (default: 60)
  • max_restart_count (default: 10)
  • tick_interval_secs (default: 30)

Commits

  • a6d81e9 feat(orchestrator): add lifecycle config fields with serde defaults and tests
  • 9a2bfa7 feat(orchestrator): add output_rx to ManagedAgent and lifecycle tracking fields
  • c3235f6 feat(orchestrator): wire reconciliation loop with lifecycle management

Tests

7 new tests: exit detection, restart cooldown, max restart cap, core agent no-restart, output event drain, full reconcile_tick cycle.

All 53 orchestrator tests + 32 spawner tests pass.

Deployed

Binary deployed to bigbox, verified reconciliation loop fires correctly with Safety agent spawn, drift detection, and alert handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions