Fix frozen spinner during MCP tool loading#2115
Merged
dgageot merged 1 commit intodocker:mainfrom Mar 16, 2026
Merged
Conversation
The ToolsetInfoEvent handler called sidebar.SetToolsetInfo() directly and returned nil, bypassing the sidebar's Update() method which starts the spinner animation. Forward the event via forwardToSidebar() so the spinner registers with the animation coordinator and animates properly. Assisted-By: docker-agent
There was a problem hiding this comment.
Review Summary
Assessment: 🟢 APPROVE
Summary
This PR successfully fixes the frozen spinner issue during MCP tool loading. The change is clean and follows good architectural patterns.
What Changed:
- Removed direct call to
sidebar.SetToolsetInfo()from the chat page - Now forwards the
ToolsetInfoEventto the sidebar viaforwardToSidebar() - The sidebar's
Update()method handles the event and manages its own state
Why This Works:
The sidebar's Update() method already has a case handler for ToolsetInfoEvent (line 707 in sidebar.go) that calls SetToolsetInfo() with the same parameters. By forwarding the event instead of directly calling the method, the sidebar can now properly manage the spinner lifecycle internally through its event loop, preventing the frozen spinner issue.
Code Quality:
- ✅ No race conditions introduced
- ✅ Follows the Elm Architecture pattern used throughout the codebase
- ✅ Maintains separation of concerns (sidebar manages its own UI state)
- ✅ No breaking changes to the API
- ✅ Consistent with how other events are handled (e.g.,
SessionTitleEvent)
Findings
No bugs detected. The implementation is correct and improves the architecture.
krissetto
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When MCP tools take a bit of time to start, the TUI feels irresponsive because it starts showing a spinner next to the number of tools but the spinner is frozen in spinning state until the final number of tools is received.
Assisted-By: docker-agent