{"record":{"id":"ffbbef41ed14797d","repo":"openai/codex","slug":"invalid-unix-timestamp-millis-value","errorCode":null,"errorMessage":"invalid unix timestamp millis: {value}","messagePattern":"invalid unix timestamp millis: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/state/src/model/thread_metadata.rs","lineNumber":671,"sourceCode":"pub(crate) fn datetime_to_epoch_millis(dt: DateTime<Utc>) -> i64 {\n    dt.timestamp_millis()\n}\n\npub(crate) fn datetime_to_epoch_seconds(dt: DateTime<Utc>) -> i64 {\n    dt.timestamp()\n}\n\npub(crate) fn epoch_millis_to_datetime(value: i64) -> Result<DateTime<Utc>> {\n    // Values older than 2020 if interpreted as milliseconds are legacy second-precision rows.\n    // Convert them in memory so old state DBs keep ordering correctly after new writes use ms.\n    const MIN_EPOCH_MILLIS: i64 = 1_577_836_800_000;\n    let millis = if value < MIN_EPOCH_MILLIS {\n        value.saturating_mul(1000)\n    } else {\n        value\n    };\n    DateTime::<Utc>::from_timestamp_millis(millis)\n        .ok_or_else(|| anyhow::anyhow!(\"invalid unix timestamp millis: {value}\"))\n}\n\npub(crate) fn epoch_seconds_to_datetime(value: i64) -> Result<DateTime<Utc>> {\n    DateTime::<Utc>::from_timestamp(value, 0)\n        .ok_or_else(|| anyhow::anyhow!(\"invalid unix timestamp seconds: {value}\"))\n}\n\n/// Statistics about a backfill operation.\n#[derive(Debug, Clone)]\npub struct BackfillStats {\n    /// The number of rollout files scanned.\n    pub scanned: usize,\n    /// The number of rows upserted successfully.\n    pub upserted: usize,\n    /// The number of rows that failed to upsert.\n    pub failed: usize,\n}\n","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/state/src/model/thread_metadata.rs#L653-L689","documentation":"Error \"invalid unix timestamp millis: {value}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/state/src/model/thread_metadata.rs:671 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"}