mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
Render selected MCP statusline providers in the TUI footer (#61979)
## What changed - With `tui_extensions_statusline` enabled, resolve the saved MCP provider and read its resource with a snapshot of the displayed thread's statusline state. - Show initialization and error messages, validate the JSON UI tree response, and preserve provider content through native statusline refreshes. Ignore stale results when the thread, provider, or working directory changes. - Request workspace headlines and thread usage for custom providers even when no built-in statusline items are selected. ## Testing Add unit coverage for response validation and footer lifecycle, plus end-to-end tests for embedded and remote app servers, startup delays, current thread metadata, and rejection of project-level provider overrides. GitOrigin-RevId: 80a46ec780c1f1536f1fd4749f468629627dedf6
This commit is contained in:
@@ -396,18 +396,26 @@ impl ChatWidget {
|
||||
)
|
||||
}
|
||||
|
||||
fn thread_usage_is_selected(&self) -> bool {
|
||||
pub(super) fn thread_usage_is_selected(&self) -> bool {
|
||||
let selected = self.selected_thread_usage();
|
||||
selected.credits || selected.estimated_cost
|
||||
}
|
||||
|
||||
fn selected_thread_usage(&self) -> SelectedThreadUsage {
|
||||
if self.selected_statusline_provider().is_some() {
|
||||
return SelectedThreadUsage {
|
||||
credits: self.plan_type != Some(PlanType::Ent26),
|
||||
estimated_cost: true,
|
||||
};
|
||||
}
|
||||
let mut selected = SelectedThreadUsage::default();
|
||||
for item in self.configured_status_line_items() {
|
||||
match item.parse::<StatusLineItem>() {
|
||||
Ok(StatusLineItem::ThreadCredits) => selected.credits = true,
|
||||
Ok(StatusLineItem::EstimatedThreadCost) => selected.estimated_cost = true,
|
||||
Ok(_) | Err(_) => {}
|
||||
if !self.read_only_history {
|
||||
for item in self.configured_status_line_items() {
|
||||
match item.parse::<StatusLineItem>() {
|
||||
Ok(StatusLineItem::ThreadCredits) => selected.credits = true,
|
||||
Ok(StatusLineItem::EstimatedThreadCost) => selected.estimated_cost = true,
|
||||
Ok(_) | Err(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
for item in self.configured_terminal_title_items() {
|
||||
|
||||
Reference in New Issue
Block a user