{"record":{"id":"5c364e778902a3ca","repo":"openai/codex","slug":"environment-id-must-not-be-empty","errorCode":null,"errorMessage":"environment id must not be empty","messagePattern":"environment id must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/secrets/src/lib.rs","lineNumber":62,"sourceCode":"}\n\nimpl fmt::Display for SecretName {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        write!(f, \"{}\", self.0)\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq, Hash)]\npub enum SecretScope {\n    Global,\n    Environment(String),\n}\n\nimpl SecretScope {\n    pub fn environment(environment_id: impl Into<String>) -> Result<Self> {\n        let env_id = environment_id.into();\n        let trimmed = env_id.trim();\n        anyhow::ensure!(!trimmed.is_empty(), \"environment id must not be empty\");\n        Ok(Self::Environment(trimmed.to_string()))\n    }\n\n    pub fn canonical_key(&self, name: &SecretName) -> String {\n        // Stable, env-safe identifier used as the on-disk map key.\n        match self {\n            Self::Global => format!(\"global/{}\", name.as_str()),\n            Self::Environment(environment_id) => {\n                format!(\"env/{environment_id}/{}\", name.as_str())\n            }\n        }\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct SecretListEntry {\n    pub scope: SecretScope,\n    pub name: SecretName,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/secrets/src/lib.rs#L44-L80","documentation":"Error \"environment id must not be empty\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/secrets/src/lib.rs:62 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"}