Files
codex/codex-rs/state/Cargo.toml
T
Adam Perry @ OpenAI a4b69a0ae9 Add session-scoped stores for stable model-facing IDs (#61339)
## What changed

- Add `SessionModelIdStore` with SQLite and in-memory implementations for looking up and assigning aliases by session, namespace, and external key.
- Commit SQLite assignments before returning them, and recheck under a write transaction so concurrent writers reuse the same alias.
- Support snapshotting and initializing alias maps from generator state and ordered keys, and remove mappings when their thread is deleted.
- Expose alias stores through `ThreadStore` and add distinct types for registered environment IDs and model-facing `env` aliases.

## Testing

Add a test using two SQLite runtime instances to verify that concurrent assignments return the same alias, different keys receive different aliases, and lookups and snapshots preserve the assignments.

GitOrigin-RevId: 2668f605251ca76d4891f70f94bfb4151ba8142c
2026-11-13 18:43:58 +00:00

38 lines
1.1 KiB
TOML

[package]
name = "codex-state"
version.workspace = true
edition.workspace = true
license.workspace = true
[dependencies]
anyhow = { workspace = true }
chrono = { workspace = true }
codex-file-system = { workspace = true }
codex-history = { workspace = true }
codex-protocol = { workspace = true }
codex-utils-absolute-path = { workspace = true }
codex-utils-model-facing-id = { workspace = true }
file-id = { workspace = true }
libsqlite3-sys = { workspace = true }
log = { workspace = true }
rand.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sqlx = { workspace = true }
sqlx-macros = { workspace = true }
sqlx-sqlite = { workspace = true }
strum = { workspace = true, features = ["derive"] }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["fs", "io-util", "macros", "rt-multi-thread", "sync", "time"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
uuid = { workspace = true }
[dev-dependencies]
codex-git-utils = { workspace = true }
pretty_assertions = { workspace = true }
scopeguard = { workspace = true }
[lints]
workspace = true