{"record":{"id":"edbb3b772ce36f62","repo":"openai/codex","slug":"failed-to-refresh-tools-for-mcp-server-codex-app","errorCode":null,"errorMessage":"failed to refresh tools for MCP server '{CODEX_APPS_MCP_SERVER_NAME}'","messagePattern":"failed to refresh tools for MCP server '(.+?)'","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server/src/request_processors/apps_processor/installed.rs","lineNumber":125,"sourceCode":"                    .await;\n\n                    let result = if runtime\n                        .latest_wait_for_server_ready(\n                            CODEX_APPS_MCP_SERVER_NAME,\n                            startup_timeout,\n                        )\n                        .await\n                    {\n                        mcp_manager\n                            .codex_apps_tools_cache()\n                            .current_snapshot(config.codex_home.to_path_buf(), cache_key.clone())\n                            .ok_or_else(|| {\n                                anyhow::anyhow!(\n                                    \"hosted connector refresh completed without publishing a snapshot\"\n                                )\n                            })\n                    } else {\n                        Err(anyhow::anyhow!(\n                            \"failed to refresh tools for MCP server '{CODEX_APPS_MCP_SERVER_NAME}'\"\n                        ))\n                    };\n                    cancellation_token.cancel();\n                    runtime.shutdown().await;\n                    result\n                }\n                .await;\n\n                match refresh_result {\n                    Ok(snapshot) => {\n                        refresh_disposition = \"success\";\n                        Some(snapshot)\n                    }\n                    Err(err) => {\n                        refresh_disposition = \"error\";\n                        retained_previous_snapshot = previous_snapshot.is_some();\n                        return Err(internal_error(format!(","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server/src/request_processors/apps_processor/installed.rs#L107-L143","documentation":"In apps_installed, after the hosted MCP server became ready, the code reads the current tools snapshot from codex_apps_tools_cache; when no snapshot is available for the cache key, this error is raised. It means the tools cache for the Codex apps MCP server could not be populated or read, so the installed-apps tool list cannot be returned.","triggerScenarios":"Thrown at codex-rs/app-server/src/request_processors/apps_processor/installed.rs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the refresh; the cache may populate after the MCP server finishes listing tools","Inspect the tools cache write path and cache_key derivation for mismatches","Check connectivity/auth to the hosted connector backend if snapshots never publish"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}