@@ -143,10 +143,12 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
143143
144144 case pubsub.Event[mcp.Event]:
145145 switch msg.Payload.Type {
146+ case mcp.EventStateChanged:
147+ return a, a.handleStateChanged(context.Background())
146148 case mcp.EventPromptsListChanged:
147− return a, a.handleMCPPromptsEvent(context.Background(), msg.Payload.Name)
149+ return a, handleMCPPromptsEvent(context.Background(), msg.Payload.Name)
148150 case mcp.EventToolsListChanged:
149− return a, a.handleMCPToolsEvent(context.Background(), msg.Payload.Name)
151+ return a, handleMCPToolsEvent(context.Background(), msg.Payload.Name)
150152 }
151153
152154 // Completions messages
@@ -627,14 +629,21 @@ func (a *appModel) View() tea.View {
627629 return view
628630}
629631
630−func (a *appModel) handleMCPPromptsEvent(ctx context.Context, name string) tea.Cmd {
632+func (a *appModel) handleStateChanged(ctx context.Context) tea.Cmd {
633+ return func() tea.Msg {
634+ a.app.UpdateAgentModel(ctx)
635+ return nil
636+ }
637+}
638+
639+func handleMCPPromptsEvent(ctx context.Context, name string) tea.Cmd {
631640 return func() tea.Msg {
632641 mcp.RefreshPrompts(ctx, name)
633642 return nil
634643 }
635644}
636645
637−func (a *appModel) handleMCPToolsEvent(ctx context.Context, name string) tea.Cmd {
646+func handleMCPToolsEvent(ctx context.Context, name string) tea.Cmd {
638647 return func() tea.Msg {
639648 mcp.RefreshTools(ctx, name)
640649 return nil