Skip to content

Domain events

The DomainEventBus is an in-process broadcast publish/subscribe bus. Features call publish(event) to emit; subscribers consume a typed on<T>() stream. Every event has occurredAt.

Event Payload Fired when
WorkspaceCreated workspaceId Workspace is created
AgentRunCompleted agentId, workspaceId, runId, status, cost Agent finishes a run
RepoAdded repoId A repo is registered
Event Payload Fired when
PullRequestPublished prNumber, repoFullName, author Agent opens a PR
PullRequestStatusChanged prNumber, repoFullName, oldStatus, newStatus PR merged/closed/opened/reopened
PrMerged prNumber, repoFullName PR is merged
ExternalPrDetected prNumber, repoFullName, author Non-agent PR found via polling — pipeline-only (drives external_pr_welcome), raises no notification
Event Payload Fired when
MessageReceived channelId, senderId, senderType New message arrives
ChannelDeleted channelId Channel is deleted
Event Payload Fired when
TicketCreated ticketId, workspaceId Ticket is created
TicketAssigned ticketId, agentId Ticket assigned to an agent
TicketStarted ticketId, agentId Agent begins work
TicketCompleted ticketId, outputJson Work finishes
TicketFailed ticketId, errorMessage Agent fails
TicketCancelled ticketId Ticket cancelled
TicketStatusChanged ticketId, oldStatus, newStatus Any status change
TicketReassigned ticketId, oldAgentId, newAgentId Ticket reassigned
TicketDelegated ticketId, delegatedByAgentId Agent delegates
TicketCollaboratorAdded ticketId, agentId Collaborator joins
TicketDetailsUpdated ticketId Metadata changes
Event Payload Fired when
PipelineRunStarted runId, templateId, workspaceId Run begins
PipelineStepStarted runId, stepId Step begins
PipelineStepCompleted runId, stepId, outputJson Step finishes
PipelineStepFailed runId, stepId, errorMessage Step fails
PipelineRunCompleted runId, totalCostCents, totalTokens Run finishes
PipelineRunFailed runId, errorMessage Run fails
Event Payload Fired when
ActivityLogged activityType, workspaceId, agentId Audit trail entry created
WorktreeMerged worktreePath, branch Worktree merge completes
BudgetThresholdCrossed agentId, scope, currentSpend, threshold Spend exceeds threshold
Event Payload Fired when
AchievementUnlocked agentId, badgeKey, metadata Agent earns a badge
Event Payload Fired when
UserCreated userId A new user is provisioned (bootstrap, invite redemption, or OIDC JIT)
WorkspaceMemberAdded workspaceId, userId, role A user joins a workspace (invite redemption or admin add)
WorkspaceMemberRemoved workspaceId, userId A member is removed — live sessions of that user scoped to the workspace must re-check access immediately
WorkspaceMemberRoleChanged workspaceId, userId, role A member’s role changes
UserDeviceRevoked deviceId, userId A device credential is revoked — its session must terminate within seconds, not on next reconnect
WorkspaceInviteRedeemed workspaceId, inviteId, userId An invite is redeemed (user exists, membership recorded, pairing begun)
Event Payload Fired when
CalendarEventsRefreshed workspaceId A calendar sync upserts events for a workspace
CalendarAuthExpired workspaceId, accountEmail A connected account’s OAuth refresh token is permanently invalid (published once per disconnection episode)
MeetingStartingSoon workspaceId, eventId, title, startTime, meetingUrl A calendar event is starting within the configured lead window
MeetingRecordingStopped workspaceId, meetingId, title, userNotes, transcript A meeting recording finishes and triggers the built-in meeting_summary pipeline

Features subscribe to events in their initialization (wired in main.dart):

  • ceoAgentSeedProviderWorkspaceCreated
  • NotificationEventMapper → all notification-producing events
  • PipelineTriggerDispatcher → all triggerable events
  • TicketDispatcherTicketAssigned
  • SnapshotAggregatorAgentRunCompleted (hourly rollup)

NotificationEventMapper maps events to AppNotification instances:

Category Source events
agentRunCompleted AgentRunCompleted
pullRequestPublished PullRequestPublished
prMerged PrMerged
newMessage MessageReceived
prMentioned PrMentioned
pipelineCompleted PipelineRunCompleted
taskCompleted TicketCompleted
achievementUnlocked AchievementUnlocked