Skip to content

Feat/agent trigger#6052

Open
bryanadenhq wants to merge 10 commits intomainfrom
feat/agent-trigger
Open

Feat/agent trigger#6052
bryanadenhq wants to merge 10 commits intomainfrom
feat/agent-trigger

Conversation

@bryanadenhq
Copy link
Collaborator

@bryanadenhq bryanadenhq commented Mar 9, 2026

Description

Moves timers and webhooks from the worker runtime to the queen level. Triggers now inject signals into the running queen loop; the queen decides whether to start the worker via run_agent_with_input().

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #6051

Changes Made

  • Added _trigger_queue and inject_trigger() to EventLoopNode -- triggers are queued separately from user messages and drained atomically via _drain_trigger_queue()
  • SessionManager.load_worker() auto-hoists async_entry_points (timer/webhook) from the worker graph onto the session as available triggers, stripping them from the worker runtime
  • New queen tools: set_trigger(), remove_trigger(), list_triggers() -- available in STAGING and RUNNING modes
  • Active trigger state persists in SessionState.active_triggers so timers survive server restarts
  • 5 new EventBus event types (TRIGGER_AVAILABLE/ACTIVATED/DEACTIVATED/FIRED/REMOVED) for frontend observability
  • Frontend: SSE handling for trigger events, countdown-to-next-fire on trigger nodes, task string editor in the node panel
  • Queen system prompt updated with trigger handling rules in both STAGING and RUNNING phases

Testing

Describe the tests you ran to verify your changes:

  • Unit tests pass (cd core && pytest tests/)
  • Lint passes (cd core && ruff check .)
  • Manual testing performed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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.

[Feature]: Agent Triggers

1 participant