mirror of
https://github.com/openai/codex.git
synced 2026-10-29 00:06:55 +00:00
Add a configurable skill catalog token budget (#38978)
## What changed - Add `[skills].max_context_tokens` to override the token budget used to render the available-skills catalog. - Require a positive value and cap configured budgets at 10,000 tokens. - Preserve the existing default of 2% of the model context window when the option is unset. ## Testing - Cover configuration parsing, override behavior, the 10,000-token cap, and catalog rendering within the configured budget. GitOrigin-RevId: f29ddcb57fc2d800c0006d03e1c33cbe3ab6272d
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//! Skill-related configuration types shared across crates.
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::num::NonZeroUsize;
|
||||
|
||||
use crate::ConfigLayerSource;
|
||||
use crate::ConfigLayerStack;
|
||||
@@ -36,6 +37,11 @@ pub struct SkillsConfig {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub include_instructions: Option<bool>,
|
||||
|
||||
/// Maximum tokens used by the available-skills catalog. Defaults to 2% of
|
||||
/// the model context window and is capped at 10,000 tokens when set.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub max_context_tokens: Option<NonZeroUsize>,
|
||||
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub config: Vec<SkillConfig>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user