{"record":{"id":"b62ec58ed99e50e2","repo":"openai/codex","slug":"status-history-thread-usage-state-poisoned","errorCode":null,"errorMessage":"status history thread-usage state poisoned","messagePattern":"status history thread-usage state poisoned","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/tui/src/status/thread_usage.rs","lineNumber":53,"sourceCode":"/// Shared state updates a committed `/status` card when its asynchronous estimate arrives.\n#[derive(Clone, Debug, Default)]\npub(crate) struct StatusThreadUsage {\n    estimate: Arc<RwLock<Option<ThreadUsage>>>,\n    reserve_label_width: Arc<AtomicBool>,\n}\n\nimpl StatusThreadUsage {\n    pub(crate) fn reserve_label_width(&self) {\n        self.reserve_label_width\n            .store(/*val*/ true, Ordering::Relaxed);\n    }\n\n    pub(crate) fn set_estimate(&self, estimate: Option<ThreadUsage>) {\n        #[expect(clippy::expect_used)]\n        let mut stored_estimate = self\n            .estimate\n            .write()\n            .expect(\"status history thread-usage state poisoned\");\n        *stored_estimate = estimate;\n    }\n\n    pub(crate) fn push_labels(&self, labels: &mut Vec<String>, seen: &mut BTreeSet<String>) {\n        // Keep existing card rows stable when asynchronous billing details arrive. Reserving a\n        // formatter label does not emit a loading placeholder or an empty billing row.\n        if self.reserve_label_width.load(Ordering::Relaxed) {\n            push_label(labels, seen, BILLED_TOKENS_LABEL);\n        }\n        #[expect(clippy::expect_used)]\n        let stored_estimate = self\n            .estimate\n            .read()\n            .expect(\"status history thread-usage state poisoned\");\n        let Some(estimate) = stored_estimate.as_ref() else {\n            return;\n        };\n        push_label(labels, seen, \"Thread usage\");","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/tui/src/status/thread_usage.rs#L35-L71","documentation":"Error \"status history thread-usage state poisoned\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/tui/src/status/thread_usage.rs:53 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"}