{"record":{"id":"e80bc69c0b862604","repo":"openai/codex","slug":"flagalreadyready","errorCode":"FlagAlreadyReady","errorMessage":"Flag is already ready. Impossible to subscribe","messagePattern":"Flag is already ready\\. Impossible to subscribe","errorType":"exception","errorClass":"ReadinessError","httpStatus":null,"severity":"error","filePath":"codex-rs/utils/readiness/src/lib.rs","lineNumber":196,"sourceCode":"            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]\n    async fn subscribe_and_mark_ready_roundtrip() -> Result<(), ReadinessError> {\n        let flag = ReadinessFlag::new();","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/utils/readiness/src/lib.rs#L178-L214","documentation":"Error \"Flag is already ready. Impossible to subscribe\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/utils/readiness/src/lib.rs:196 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"}