feat: cache tokenizer (#6609)

This commit is contained in:
jif-oai
2025-11-14 17:05:00 +01:00
committed by GitHub
parent 63c8c01f40
commit f17b392470
8 changed files with 112 additions and 45 deletions

View File

@@ -3,6 +3,7 @@ use crate::config::types::McpServerConfig;
use crate::config::types::Notice;
use anyhow::Context;
use codex_protocol::config_types::ReasoningEffort;
use codex_utils_tokenizer::warm_model_cache;
use std::collections::BTreeMap;
use std::path::Path;
use std::path::PathBuf;
@@ -229,6 +230,9 @@ impl ConfigDocument {
fn apply(&mut self, edit: &ConfigEdit) -> anyhow::Result<bool> {
match edit {
ConfigEdit::SetModel { model, effort } => Ok({
if let Some(model) = &model {
warm_model_cache(model)
}
let mut mutated = false;
mutated |= self.write_profile_value(
&["model"],