mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
Add auto-compaction fallback token-budget settings (#33243)
## What changed - Add `auto_compact_fallback_prompt` and `auto_compact_fallback_buffer_tokens` to `features.token_budget` and the generated configuration schema. - Trim empty fallback prompts, limit prompts to 2,000 bytes, require a buffer when a prompt is configured, and reject non-positive buffer values. - Preserve the new settings when locking resolved session configuration. ## Testing - Cover config resolution and validation for overlong prompts, missing buffers, and non-positive buffers. - Extend the configuration-lock test to cover both settings. GitOrigin-RevId: 6463f963ba1dbd633d76601b8344360a8c85cf8b
This commit is contained in:
@@ -98,6 +98,14 @@ pub struct TokenBudgetConfigToml {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[schemars(length(max = 2000))]
|
||||
pub guidance_message: Option<String>,
|
||||
/// Developer message sampled before an automatic context-window rollover.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[schemars(length(max = 2000))]
|
||||
pub auto_compact_fallback_prompt: Option<String>,
|
||||
/// Additional tokens available after the compaction threshold for fallback note-taking.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[schemars(range(min = 1))]
|
||||
pub auto_compact_fallback_buffer_tokens: Option<i64>,
|
||||
}
|
||||
|
||||
impl FeatureConfig for TokenBudgetConfigToml {
|
||||
|
||||
Reference in New Issue
Block a user