Skip to content

feat: add agent lifecycle hooks (created, updated, deleted)#1023

Merged
chubes4 merged 1 commit intomainfrom
feat/agent-lifecycle-hooks
Apr 7, 2026
Merged

feat: add agent lifecycle hooks (created, updated, deleted)#1023
chubes4 merged 1 commit intomainfrom
feat/agent-lifecycle-hooks

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 7, 2026

Summary

Adds WordPress do_action hooks to the agent lifecycle in AgentAbilities.php, enabling WP-side integrations to react when agents are created, updated, or deleted.

Hooks added

Hook Params Fires when
datamachine_agent_created $agent_id, $slug, $name After agent creation + scaffolding
datamachine_agent_updated $agent_id After agent fields are updated
datamachine_agent_deleted $agent_id, $slug After agent DB records are removed

Why

These hooks enable downstream integrations — like the wp-opencode multi-agent sync plugin — to automatically detect and respond to agent changes without polling.

Testing

  • Hooks fire after all business logic (validation, DB writes, scaffolding) succeeds
  • No behavioral change to existing code — purely additive

Add do_action hooks to AgentAbilities for agent create, update, and
delete operations. These enable WP-side integrations to react to agent
lifecycle events (e.g. syncing agents to external runtimes).

Hooks added:
- datamachine_agent_created($agent_id, $slug, $name)
- datamachine_agent_updated($agent_id)
- datamachine_agent_deleted($agent_id, $slug)
@chubes4 chubes4 merged commit 715c152 into main Apr 7, 2026
1 check failed
@chubes4 chubes4 deleted the feat/agent-lifecycle-hooks branch April 7, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant