{"record":{"id":"ef0976b7ae832cef","repo":"openai/codex","slug":"tokenlockfailed","errorCode":"TokenLockFailed","errorMessage":"Failed to acquire readiness token lock","messagePattern":"Failed to acquire readiness token lock","errorType":"exception","errorClass":"ReadinessError","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/readiness/src/lib.rs","lineNumber":194,"sourceCode":"        // Fast-path check before awaiting.\n        if *rx.borrow() {\n            return;\n        }\n        // Await changes until true is observed.\n        while rx.changed().await.is_ok() {\n            if *rx.borrow() {\n                break;\n            }\n        }\n    }\n}\n\nmod errors {\n    use thiserror::Error;\n\n    #[derive(Debug, Error)]\n    pub enum ReadinessError {\n        #[error(\"Failed to acquire readiness token lock\")]\n        TokenLockFailed,\n        #[error(\"Flag is already ready. Impossible to subscribe\")]\n        FlagAlreadyReady,\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use std::sync::Arc;\n    use std::sync::atomic::Ordering;\n\n    use super::Readiness;\n    use super::ReadinessFlag;\n    use super::Token;\n    use super::errors::ReadinessError;\n    use assert_matches::assert_matches;\n\n    #[tokio::test]","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/readiness/src/lib.rs#L176-L212","documentation":"Error \"Failed to acquire readiness token lock\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/utils/readiness/src/lib.rs:194 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"}