core/tui: non-blocking MCP startup (#6334)

This makes MCP startup not block TUI startup. Messages sent while MCPs
are booting will be queued.


https://github.com/user-attachments/assets/96e1d234-5d8f-4932-a935-a675d35c05e0


Fixes #6317

---------

Co-authored-by: pakrym-oai <pakrym@openai.com>
This commit is contained in:
Jeremy Rose
2025-11-17 11:26:11 -08:00
committed by GitHub
parent ae2a084fae
commit 03ffe4d595
14 changed files with 841 additions and 537 deletions

View File

@@ -58,8 +58,6 @@ use tempfile::tempdir;
use tokio::sync::mpsc::error::TryRecvError;
use tokio::sync::mpsc::unbounded_channel;
const TEST_WARNING_MESSAGE: &str = "Heads up: Long conversations and multiple compactions can cause the model to be less accurate. Start a new conversation when possible to keep conversations small and targeted.";
fn test_config() -> Config {
// Use base defaults to avoid depending on host state.
Config::load_from_base_config_with_overrides(
@@ -268,6 +266,7 @@ fn make_chatwidget_manual() -> (
stream_controller: None,
running_commands: HashMap::new(),
task_complete_pending: false,
mcp_startup_status: None,
interrupts: InterruptManager::new(),
reasoning_buffer: String::new(),
full_reasoning_buffer: String::new(),
@@ -2439,7 +2438,7 @@ fn warning_event_adds_warning_history_cell() {
chat.handle_codex_event(Event {
id: "sub-1".into(),
msg: EventMsg::Warning(WarningEvent {
message: TEST_WARNING_MESSAGE.to_string(),
message: "test warning message".to_string(),
}),
});
@@ -2447,7 +2446,7 @@ fn warning_event_adds_warning_history_cell() {
assert_eq!(cells.len(), 1, "expected one warning history cell");
let rendered = lines_to_single_string(&cells[0]);
assert!(
rendered.contains(TEST_WARNING_MESSAGE),
rendered.contains("test warning message"),
"warning cell missing content: {rendered}"
);
}