{"record":{"id":"b4ae09ba862ac95a","repo":"openai/codex","slug":"mcp-runtime-refresh-semaphore-closed","errorCode":null,"errorMessage":"MCP runtime refresh semaphore closed","messagePattern":"MCP runtime refresh semaphore closed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/session/mcp.rs","lineNumber":255,"sourceCode":"            )\n            .await;\n            refresh_invalidation.published = true;\n            if !self.mcp_refresh.is_pending() {\n                return;\n            }\n        }\n    }\n\n    /// Reconnects the runtime so refreshed Apps tools belong to their new exact client.\n    pub(crate) async fn hard_refresh_latest_codex_apps_tools(\n        self: &Arc<Self>,\n    ) -> anyhow::Result<Vec<codex_mcp::ToolInfo>> {\n        self.refresh_mcp_if_dirty().await;\n        let _refresh = self\n            .mcp_refresh\n            .acquire()\n            .await\n            .map_err(|_| anyhow::anyhow!(\"MCP runtime refresh semaphore closed\"))?;\n        let auth = self.services.auth_manager.auth().await;\n        let desired = self.latest_mcp_desired_state(auth).await;\n        let selected_capability_roots = self\n            .resolve_selected_capability_roots_for_step(&desired.environments)\n            .await;\n        let ready_selected_capability_roots =\n            Self::ready_selected_capability_roots(&selected_capability_roots);\n        let executor_capability_discovery = self\n            .executor_capability_discovery_for_step(\n                &desired.config,\n                &ready_selected_capability_roots,\n                &desired.environments,\n                desired.windows_sandbox_level,\n            )\n            .await;\n        let mcp_projection = self\n            .services\n            .mcp_manager","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/session/mcp.rs#L237-L273","documentation":"Error \"MCP runtime refresh semaphore closed\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/core/src/session/mcp.rs:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restart the session; the MCP runtime refresh subsystem has shut down."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}