Skip to content

feat(agent): persist action execution state and idempotency #92

@05F3759DF

Description

@05F3759DF

Context

Keystone action requests may be delivered more than once because the reliable source of truth is the Keystone action queue and WebSocket push is only a wake-up path. Axon Agent needs local execution state so retries, reconnects, and agent restarts do not trigger duplicate script runs.

Scope

  • Persist local action execution records keyed by request_id.
  • Track action_id, status, queued_at, started_at, finished_at, exit_code, and error_summary.
  • Treat duplicate request_id delivery as idempotent and return the existing state.
  • Mark stale in-flight executions consistently after agent restart.
  • Respect action request expiration time and avoid starting expired requests.

Acceptance Criteria

  • Re-delivering the same request_id does not execute the action twice.
  • Agent restart preserves completed and failed execution state.
  • Expired requests are reported as expired and are not executed.
  • Local state can be inspected for operator diagnostics.
  • Tests cover duplicate request delivery, restart recovery, expired request handling, and completed/failed state persistence.

Depends On

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devicesRobot/device inventory, health, and lifecyclearea:opsOperations, recovery, incidents, and site workflowscppC++ codecross-repo:keystoneRequires coordination with archebase/keystoneenhancementNew feature or requestpriority:p1High priority for production operations

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions