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 enum | Variant | Key fields | Emitter | Typical subscriber |
|---|---|---|---|---|
StreamManagerEvent | StreamStarted | conversation_id | StreamManager | ChattyApp |
TextChunk | conversation_id, text | StreamManager | ChattyApp → ChatView | |
ToolCallStarted | conversation_id, id, name | StreamManager | ChattyApp → ChatView | |
ToolCallInput | conversation_id, id, arguments | StreamManager | ChattyApp → ChatView | |
ToolCallResult | conversation_id, id, result | StreamManager | ChattyApp → ChatView | |
ToolCallError | conversation_id, id, error | StreamManager | ChattyApp → ChatView | |
ApprovalRequested | conversation_id, id, command, is_sandboxed | StreamManager | ChattyApp → ChatView | |
ApprovalResolved | conversation_id, id, approved | StreamManager | ChattyApp → ChatView | |
ClarificationRequested | conversation_id, id, questions | StreamManager | ChattyApp → ChatView (ask-user card) | |
TokenUsage | conversation_id, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens | StreamManager | ChattyApp | |
TurnProgress | conversation_id, turn, tokens | StreamManager | ChattyApp → ChatInputState (live turn/token/elapsed indicator) | |
SwarmTreeChanged | conversation_id, trace | StreamManager | ChattyApp → ChatView (swarm tree under each delegation row, TB-4); RunningAgentsModel (every conversation, TB-6) | |
StreamEnded | conversation_id, status, token_usage, trace_json, … | StreamManager | ChattyApp (finalization); RunningAgentsModel (drops the conversation’s live agents) | |
RunningAgentsEvent | CountsChanged | — | RunningAgentsModel | ChattyApp (redraws the footer’s running-agents chip, TB-6) |
SidebarEvent | NewChat | — | SidebarView | ChattyApp |
OpenSettings | — | SidebarView | ChattyApp | |
SelectConversation | String (id) | SidebarView | ChattyApp | |
DeleteConversation | String (id) | SidebarView | ChattyApp | |
ExportConversation | String (id) | SidebarView | ChattyApp | |
ToggleCollapsed | bool | SidebarView | ChattyApp | |
LoadMore | — | SidebarView | ChattyApp | |
ChatInputEvent | Send | message, attachments | ChatInputState | ChattyApp |
ModelChanged | String (model id) | ChatInputState | ChattyApp | |
Stop | — | ChatInputState | ChattyApp | |
SlashCommandSelected | String (command) | ChatInputState | ChattyApp | |
WorkingDirChanged | Option<PathBuf> | ChatInputState | ChattyApp | |
ChatViewEvent | FeedbackChanged | history_index, feedback | ChatView | ChattyApp |
RegenerateMessage | history_index | ChatView | ChattyApp | |
ArtifactViewEvent | Closed | — | ArtifactView | ChatView |
PresentationChanged | — | ArtifactView | ChatView | |
BrowserControlChanged | taken, url | ArtifactView | ChatView (activity trail) | |
TerminalDockEvent | Hidden | — | TerminalDock | ChatView (refocuses the composer) |
TerminalViewEvent | TitleChanged / Exited | — | TerminalView | TerminalDock (tab strip) |
TraceEvent | ToolCallStateChanged | tool_id, old_state, new_state | SystemTraceView | ChatView |
ToolCallInputReceived | tool_id | SystemTraceView | ChatView | |
ToolCallOutputReceived | tool_id, has_output | SystemTraceView | ChatView | |
ThinkingStateChanged | old_state, new_state | SystemTraceView | ChatView | |
ModelsNotifierEvent | ModelsReady | — | ModelsNotifier | ChattyApp (startup) |
AgentConfigEvent | RebuildRequired | — | AgentConfigNotifier | Settings controllers, ChattyApp |
ErrorNotifierEvent | NewError | — | ErrorNotifier | ChattyApp (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.