{"record":{"id":"1d7ac4e1020ee7db","repo":"openai/codex","slug":"mcp-stdin-closed","errorCode":null,"errorMessage":"MCP stdin closed","messagePattern":"MCP stdin closed","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/local_stdio_transport.rs","lineNumber":150,"sourceCode":"impl Transport<RoleClient> for LocalStdioTransport {\n    type Error = io::Error;\n\n    #[expect(\n        clippy::await_holding_invalid_type,\n        reason = \"complete JSON-RPC frames must hold the stdin lock across writes\"\n    )]\n    fn send(\n        &mut self,\n        item: TxJsonRpcMessage<RoleClient>,\n    ) -> impl Future<Output = Result<(), Self::Error>> + Send + 'static {\n        let stdin = Arc::clone(&self.stdin);\n        async move {\n            let mut message = serde_json::to_vec(&item).map_err(io::Error::other)?;\n            message.push(b'\\n');\n            let mut guard = stdin.lock().await;\n            let stdin = guard\n                .as_mut()\n                .ok_or_else(|| io::Error::new(io::ErrorKind::BrokenPipe, \"MCP stdin closed\"))?;\n            stdin.write_all(&message).await?;\n            stdin.flush().await\n        }\n    }\n\n    fn receive(&mut self) -> impl Future<Output = Option<RxJsonRpcMessage<RoleClient>>> + Send {\n        self.receive_message()\n    }\n\n    async fn close(&mut self) -> Result<(), Self::Error> {\n        self.stdin.lock().await.take();\n        match tokio::time::timeout(Duration::from_secs(3), self.child.wait()).await {\n            Ok(status) => {\n                status?;\n                Ok(())\n            }\n            Err(_) => self.child.kill().await,\n        }","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/local_stdio_transport.rs#L132-L168","documentation":"Error \"MCP stdin closed\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/local_stdio_transport.rs:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}