Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GPUI event catalog

When to read this: Wire a new entity subscriber, debug event flow, or find which component emits a variant.

All entity-to-entity communication uses EventEmitter + cx.subscribe() (see entity-communication). This table lists the typed events in chatty-gpui and chatty-core.

Event enumVariantKey fieldsEmitterTypical subscriber
StreamManagerEventStreamStartedconversation_idStreamManagerChattyApp
TextChunkconversation_id, textStreamManagerChattyApp → ChatView
ToolCallStartedconversation_id, id, nameStreamManagerChattyApp → ChatView
ToolCallInputconversation_id, id, argumentsStreamManagerChattyApp → ChatView
ToolCallResultconversation_id, id, resultStreamManagerChattyApp → ChatView
ToolCallErrorconversation_id, id, errorStreamManagerChattyApp → ChatView
ApprovalRequestedconversation_id, id, command, is_sandboxedStreamManagerChattyApp → ChatView
ApprovalResolvedconversation_id, id, approvedStreamManagerChattyApp → ChatView
ClarificationRequestedconversation_id, id, questionsStreamManagerChattyApp → ChatView (ask-user card)
TokenUsageconversation_id, input_tokens, output_tokens, cache_read_tokens, cache_write_tokensStreamManagerChattyApp
TurnProgressconversation_id, turn, tokensStreamManagerChattyApp → ChatInputState (live turn/token/elapsed indicator)
SwarmTreeChangedconversation_id, traceStreamManagerChattyApp → ChatView (swarm tree under each delegation row, TB-4); RunningAgentsModel (every conversation, TB-6)
StreamEndedconversation_id, status, token_usage, trace_json, …StreamManagerChattyApp (finalization); RunningAgentsModel (drops the conversation’s live agents)
RunningAgentsEventCountsChanged—RunningAgentsModelChattyApp (redraws the footer’s running-agents chip, TB-6)
SidebarEventNewChat—SidebarViewChattyApp
OpenSettings—SidebarViewChattyApp
SelectConversationString (id)SidebarViewChattyApp
DeleteConversationString (id)SidebarViewChattyApp
ExportConversationString (id)SidebarViewChattyApp
ToggleCollapsedboolSidebarViewChattyApp
LoadMore—SidebarViewChattyApp
ChatInputEventSendmessage, attachmentsChatInputStateChattyApp
ModelChangedString (model id)ChatInputStateChattyApp
Stop—ChatInputStateChattyApp
SlashCommandSelectedString (command)ChatInputStateChattyApp
WorkingDirChangedOption<PathBuf>ChatInputStateChattyApp
ChatViewEventFeedbackChangedhistory_index, feedbackChatViewChattyApp
RegenerateMessagehistory_indexChatViewChattyApp
ArtifactViewEventClosed—ArtifactViewChatView
PresentationChanged—ArtifactViewChatView
BrowserControlChangedtaken, urlArtifactViewChatView (activity trail)
TerminalDockEventHidden—TerminalDockChatView (refocuses the composer)
TerminalViewEventTitleChanged / Exited—TerminalViewTerminalDock (tab strip)
TraceEventToolCallStateChangedtool_id, old_state, new_stateSystemTraceViewChatView
ToolCallInputReceivedtool_idSystemTraceViewChatView
ToolCallOutputReceivedtool_id, has_outputSystemTraceViewChatView
ThinkingStateChangedold_state, new_stateSystemTraceViewChatView
ModelsNotifierEventModelsReady—ModelsNotifierChattyApp (startup)
AgentConfigEventRebuildRequired—AgentConfigNotifierSettings controllers, ChattyApp
ErrorNotifierEventNewError—ErrorNotifierChattyApp (toast/banner)

Source files: stream_manager.rs, sidebar_view.rs, chat_input/mod.rs, chat_view/mod.rs, transcript/artifact_view.rs, terminal/dock.rs, terminal/mod.rs, message_types.rs (TraceEvent), models_notifier.rs, agent_config_notifier.rs, error_notifier.rs. This table is hand-maintained; CI checks that every EventEmitter enum and every StreamManagerEvent variant has a row (make docs-check-reference).

Adding a new event: define an enum on the emitter entity, impl EventEmitter<YourEvent>, subscribe in the parent (usually ChattyApp or ChatView). Never use Arc<dyn Fn> callbacks between entities. Step-by-step: Add a desktop GPUI view.