diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock
index 3ec2708880..da19f30103 100644
--- a/codex-rs/Cargo.lock
+++ b/codex-rs/Cargo.lock
@@ -1247,6 +1247,7 @@ version = "0.0.0"
dependencies = [
"serde_json",
"thiserror 2.0.16",
+ "tokio",
]
[[package]]
diff --git a/codex-rs/internal-storage/Cargo.toml b/codex-rs/internal-storage/Cargo.toml
index cd419326c8..ccc30337b9 100644
--- a/codex-rs/internal-storage/Cargo.toml
+++ b/codex-rs/internal-storage/Cargo.toml
@@ -6,6 +6,7 @@ edition.workspace = true
[dependencies]
serde_json = { workspace = true }
thiserror = { workspace = true }
+tokio = { workspace = true, features = ["rt", "sync"] }
[lints]
workspace = true
diff --git a/codex-rs/internal-storage/src/lib.rs b/codex-rs/internal-storage/src/lib.rs
index 6a2efbaca5..5504626368 100644
--- a/codex-rs/internal-storage/src/lib.rs
+++ b/codex-rs/internal-storage/src/lib.rs
@@ -4,9 +4,11 @@ use std::fs;
use std::io;
use std::path::Path;
use std::path::PathBuf;
-use std::sync::Mutex;
use std::sync::OnceLock;
use thiserror::Error;
+use tokio::runtime::Builder as RuntimeBuilder;
+use tokio::runtime::Handle as RuntimeHandle;
+use tokio::sync::Mutex;
const INTERNAL_STORAGE_FILENAME: &str = "internal_storage.json";
@@ -58,14 +60,14 @@ impl Storage {
Ok(())
}
- fn read(&self, key: &str) -> Result