mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
test(core): make mcp readiness waits state aware
This commit is contained in:
@@ -23,6 +23,7 @@ use codex_protocol::openai_models::ReasoningEffort;
|
||||
use codex_protocol::protocol::AdditionalContextEntry;
|
||||
use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::protocol::Event;
|
||||
use codex_protocol::protocol::McpStartupFailure;
|
||||
use codex_protocol::protocol::Op;
|
||||
use codex_protocol::protocol::SandboxPolicy;
|
||||
use codex_protocol::protocol::SessionConfiguredEvent;
|
||||
@@ -142,6 +143,24 @@ impl CodexThread {
|
||||
self.codex.shutdown_and_wait().await
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub async fn wait_for_mcp_servers_ready(
|
||||
&self,
|
||||
server_names: &[String],
|
||||
) -> Vec<McpStartupFailure> {
|
||||
let readiness = {
|
||||
let manager = self
|
||||
.codex
|
||||
.session
|
||||
.services
|
||||
.mcp_connection_manager
|
||||
.read()
|
||||
.await;
|
||||
manager.wait_for_servers_ready(server_names)
|
||||
};
|
||||
readiness.await
|
||||
}
|
||||
|
||||
/// Wait until the underlying session loop has terminated.
|
||||
pub async fn wait_until_terminated(&self) {
|
||||
self.codex.session_loop_termination.clone().await;
|
||||
|
||||
Reference in New Issue
Block a user