mirror of
https://github.com/openai/codex.git
synced 2026-11-10 08:43:33 +00:00
Rename the history notes extension config option (#39830)
## What changed Rename the token-budget configuration key and its Rust field from `use_history_notes_history` to `use_history_notes_extension`. Update the config schema, extension gating, explicit-setting detection, and tests to use the new name consistently. GitOrigin-RevId: b6a514e23f02095fcd1d35dc42eeb7394b800c77
This commit is contained in:
1 parent
daa48072f4
commit
d8ec270183
9 files changed
+18
-18
No files matched your search
@@ -654,7 +654,7 @@ async fn load_config_resolves_token_budget_config() -> std::io::Result<()> {
|
||||
r#"
|
||||
[features.token_budget]
|
||||
enabled = true
|
||||
use_history_notes_history = true
|
||||
use_history_notes_extension = true
|
||||
reminder_threshold_tokens = 16000
|
||||
reminder_message_template = "Custom reminder: {n_remaining} tokens."
|
||||
guidance_message = "Preserve important state before compaction."
|
||||
@@ -662,7 +662,7 @@ auto_compact_fallback_prompt = " Write notes immediately. "
|
||||
auto_compact_fallback_buffer_tokens = 8000
|
||||
"#,
|
||||
TokenBudgetConfig {
|
||||
use_history_notes_history: true,
|
||||
use_history_notes_extension: true,
|
||||
reminder_threshold_tokens: Some(16_000),
|
||||
reminder_message_template: "Custom reminder: {n_remaining} tokens.".to_string(),
|
||||
guidance_message: Some("Preserve important state before compaction.".to_string()),
|
||||
|
||||
@@ -1087,7 +1087,7 @@ const AUTO_COMPACT_FALLBACK_PROMPT_MAX_BYTES: usize = 2000;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
|
||||
pub struct TokenBudgetConfig {
|
||||
pub use_history_notes_history: bool,
|
||||
pub use_history_notes_extension: bool,
|
||||
pub reminder_threshold_tokens: Option<i64>,
|
||||
pub reminder_message_template: String,
|
||||
pub guidance_message: Option<String>,
|
||||
@@ -1180,7 +1180,7 @@ impl TokenBudgetConfig {
|
||||
impl Default for TokenBudgetConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
use_history_notes_history: false,
|
||||
use_history_notes_extension: false,
|
||||
reminder_threshold_tokens: None,
|
||||
reminder_message_template: DEFAULT_TOKEN_BUDGET_REMINDER_MESSAGE_TEMPLATE.to_string(),
|
||||
guidance_message: None,
|
||||
@@ -2720,8 +2720,8 @@ fn resolve_token_budget_config(
|
||||
}
|
||||
|
||||
let token_budget_config = token_budget_toml_config(config_toml.features.as_ref());
|
||||
let use_history_notes_history = token_budget_config
|
||||
.and_then(|config| config.use_history_notes_history)
|
||||
let use_history_notes_extension = token_budget_config
|
||||
.and_then(|config| config.use_history_notes_extension)
|
||||
.unwrap_or_default();
|
||||
let reminder_threshold_tokens =
|
||||
token_budget_config.and_then(|config| config.reminder_threshold_tokens);
|
||||
@@ -2740,7 +2740,7 @@ fn resolve_token_budget_config(
|
||||
token_budget_config.and_then(|config| config.auto_compact_fallback_buffer_tokens);
|
||||
|
||||
let token_budget = TokenBudgetConfig {
|
||||
use_history_notes_history,
|
||||
use_history_notes_extension,
|
||||
reminder_threshold_tokens,
|
||||
reminder_message_template,
|
||||
guidance_message,
|
||||
|
||||
Reference in new issue
Block a user