{"record":{"id":"ffbc04fcc99e6e53","repo":"openai/codex","slug":"thread-usage-response-did-not-contain-requested-th","errorCode":null,"errorMessage":"thread usage response did not contain requested thread {thread_id}","messagePattern":"thread usage response did not contain requested thread (.+?)","errorType":"exception","errorClass":"RequestError","httpStatus":null,"severity":"error","filePath":"codex-rs/backend-client/src/client/thread_usage.rs","lineNumber":68,"sourceCode":"        let url = self.thread_usage_url();\n        let request = self\n            .request(Method::POST, &url)\n            .headers(self.headers())\n            .header(CONTENT_TYPE, HeaderValue::from_static(\"application/json\"))\n            .json(&ThreadUsageQueryRequest {\n                thread_ids: [thread_id],\n            });\n        let (body, content_type) = self.exec_request_detailed(request, \"POST\", &url).await?;\n        let response = self\n            .decode_json::<ThreadUsageQueryResponse>(&url, &content_type, &body)\n            .map_err(RequestError::from)?;\n\n        response\n            .threads\n            .into_iter()\n            .find(|usage| usage.thread_id == thread_id)\n            .ok_or_else(|| {\n                RequestError::from(anyhow!(\n                    \"thread usage response did not contain requested thread {thread_id}\"\n                ))\n            })\n    }\n\n    fn thread_usage_url(&self) -> String {\n        match self.path_style {\n            PathStyle::CodexApi => {\n                format!(\"{}/api/codex/usage/thread_usage/query\", self.base_url)\n            }\n            PathStyle::ChatGptApi => {\n                format!(\"{}/wham/usage/thread_usage/query\", self.base_url)\n            }\n        }\n    }\n}\n\n#[cfg(test)]","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/backend-client/src/client/thread_usage.rs#L50-L86","documentation":"Error \"thread usage response did not contain requested thread {thread_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/backend-client/src/client/thread_usage.rs:68 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"}