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.

EventPayloadFired when
WorkspaceCreatedworkspaceIdWorkspace is created
AgentRunCompletedagentId, workspaceId, runId, status, costAgent finishes a run
RepoAddedrepoIdA repo is registered
EventPayloadFired when
PullRequestPublishedprNumber, repoFullName, authorAgent opens a PR
PullRequestStatusChangedprNumber, repoFullName, oldStatus, newStatusPR merged/closed/opened/reopened
PrMergedprNumber, repoFullNamePR is merged
ExternalPrDetectedprNumber, repoFullName, authorNon-agent PR found via polling
EventPayloadFired when
MessageReceivedchannelId, senderId, senderTypeNew message arrives
ConversationDeletedchannelIdConversation is deleted
EventPayloadFired when
TicketCreatedticketId, workspaceIdTicket is created
TicketAssignedticketId, agentIdTicket assigned to an agent
TicketStartedticketId, agentIdAgent begins work
TicketCompletedticketId, outputJsonWork finishes
TicketFailedticketId, errorMessageAgent fails
TicketCancelledticketIdTicket cancelled
TicketStatusChangedticketId, oldStatus, newStatusAny status change
TicketReassignedticketId, oldAgentId, newAgentIdTicket reassigned
TicketDelegatedticketId, delegatedByAgentIdAgent delegates
TicketCollaboratorAddedticketId, agentIdCollaborator joins
TicketDetailsUpdatedticketIdMetadata changes
EventPayloadFired when
PipelineRunStartedrunId, templateId, workspaceIdRun begins
PipelineStepStartedrunId, stepIdStep begins
PipelineStepCompletedrunId, stepId, outputJsonStep finishes
PipelineStepFailedrunId, stepId, errorMessageStep fails
PipelineRunCompletedrunId, totalCostCents, totalTokensRun finishes
PipelineRunFailedrunId, errorMessageRun fails
EventPayloadFired when
ActivityLoggedactivityType, workspaceId, agentIdAudit trail entry created
WorktreeMergedworktreePath, branchWorktree merge completes
BudgetThresholdCrossedagentId, scope, currentSpend, thresholdSpend exceeds threshold
EventPayloadFired when
AchievementUnlockedagentId, badgeKey, metadataAgent earns a badge
EventPayloadFired when
CalendarEventsRefreshedworkspaceIdA calendar sync upserts events for a workspace
CalendarAuthExpiredworkspaceId, accountEmailA connected account’s OAuth refresh token is permanently invalid (published once per disconnection episode)
MeetingStartingSoonworkspaceId, eventId, title, startTime, meetingUrlA calendar event is starting within the configured lead window
MeetingRecordingStoppedworkspaceId, meetingId, title, userNotes, transcriptA meeting recording finishes — 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:

CategorySource events
agentRunCompletedAgentRunCompleted
pullRequestPublishedPullRequestPublished
prMergedPrMerged
newMessageMessageReceived
externalPrExternalPrDetected
pipelineCompletedPipelineRunCompleted
taskCompletedTicketCompleted
achievementUnlockedAchievementUnlocked