mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
## Why Decimal IDs of up to three digits fit in a single token. Issuing shorter IDs first keeps identifiers compact in model context. ## What changed Add `codex-utils-model-facing-id` with deterministic, seed-based ID generation. Each salt prefixes the displayed ID and derives a separate sequence from the session seed. The generator shuffles decimal pools, exhausting `000`–`999` before issuing six-digit suffixes, then expanding in groups of three digits. Support serializable, versioned snapshots that resume at the next unissued ID, plus suffix-only formatting for protocols that supply their own prefix. ## Testing Add integration tests for pool exhaustion, stable outputs across pool boundaries, serialization and restore, salt-based seed derivation, invalid snapshots, and wraparound after the last `u64` ordinal. GitOrigin-RevId: 80ffbf861106980b731d34a61ca2b9448d3bbb0d
7 lines
139 B
Python
7 lines
139 B
Python
load("//:defs.bzl", "codex_rust_crate")
|
|
|
|
codex_rust_crate(
|
|
name = "model-facing-id",
|
|
crate_name = "codex_utils_model_facing_id",
|
|
)
|