mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Deduplicate model catalog strings in memory (#63735)
## Why Identical instructions and tool descriptions can appear in multiple model catalog records. Each decode or clone previously allocated its own copy of that text. ## What changed Use `CodexCachedStr` for catalog instructions, messages, and tool overrides. It stores short strings inline and interns longer strings so independent decodes and clones can share storage. Resolved incremental tool messages also reuse cached text from overrides and bundled defaults. JSON and generated TypeScript still represent these values as strings. ## Testing Add tests for shared storage across catalog fields, independent decodes, clones, and incremental tool defaults. Cover plain JSON string round trips and borrowed access to short inline UTF-8 strings. GitOrigin-RevId: 6f53b4e19f01f6ed52a8fd364279b924cf794be2
This commit is contained in:
committed by
copyberry
parent
7a24022794
commit
9a3c131eb4
@@ -41,7 +41,7 @@ async fn remote_exec_forwards_model_and_effort_and_preserves_omitted_settings()
|
||||
let mut model = template.clone();
|
||||
model.slug = slug.to_string();
|
||||
model.model_messages = Some(codex_protocol::openai_models::ModelMessages {
|
||||
instructions_template: Some(format!("Base instructions for {slug}")),
|
||||
instructions_template: Some(format!("Base instructions for {slug}").into()),
|
||||
..Default::default()
|
||||
});
|
||||
model
|
||||
|
||||
Reference in New Issue
Block a user