fix(tui): make PS panel detail updates non-blocking for responsive UI#376
Open
fix(tui): make PS panel detail updates non-blocking for responsive UI#376
Conversation
Previously, _update_run_detail_panel made blocking calls to fetch chat messages, session output, and issue data on the main UI thread, causing the panel to freeze while loading. This change: - Splits detail panel updates into immediate (non-blocking) and async parts - Shows loading indicators while async data is being fetched - Uses Textual's @work decorator with separate worker groups for detail data - Updates UI from background thread via call_from_thread - Applies same pattern to OrchMonitorApp for consistency The runs table now loads immediately, tabs show loading state, and populate asynchronously without blocking user input. Fixes orch-379 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
Summary
Problem
The PS panel had severe responsiveness issues:
Root Cause:
_update_run_detail_panelmade blocking calls (HTTP requests, subprocess calls, daemon API) on the main UI thread.Solution
Split detail panel updates into two phases:
Immediate update (non-blocking):
Async fetch (background worker):
call_from_threadwhen data arrivesChanges
runs_dashboard.hy_update_run_detail_panel_immediate: Shows data without blocking calls_fetch_additional_detail_data: Worker to fetch chat/session/issue data async_apply_additional_detail_data: Updates tabs with fetched data_set_selected_run: Calls immediate update then triggers async fetchorch_monitor_app.hy_show_run_detail_immediate: Shows immediate data with loading indicator_fetch_run_session_output: Worker to fetch session output async_apply_run_session_output: Updates detail panel with fetched data_show_run_detail_callback: Uses new async patternAcceptance Criteria
Testing
@workdecoratorFixes orch-379