feat: use latest disk value for mcp servers status (#7907)

### Summary
Instead of stale in memory config value for listing mcp server statuses,
we pull the latest disk value.
This commit is contained in:
Shijie Rao 2025-12-11 18:56:55 -08:00 committed by GitHub
parent 9e91e49edb
commit 163a7e317e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2079,12 +2079,19 @@ impl CodexMessageProcessor {
}
async fn list_mcp_servers(&self, request_id: RequestId, params: ListMcpServersParams) {
let snapshot = collect_mcp_snapshot(self.config.as_ref()).await;
let config = match self.load_latest_config().await {
Ok(config) => config,
Err(error) => {
self.outgoing.send_error(request_id, error).await;
return;
}
};
let snapshot = collect_mcp_snapshot(&config).await;
let tools_by_server = group_tools_by_server(&snapshot.tools);
let mut server_names: Vec<String> = self
.config
let mut server_names: Vec<String> = config
.mcp_servers
.keys()
.cloned()