mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Preserve skill catalog entries under metadata pressure (#34732)
## Why Long skill descriptions can consume the catalog's metadata budget before later skills are listed, hiding otherwise usable skills from the model. ## What changed - Reserve space for every skill's name and locator when those minimum lines fit. - Distribute the remaining token or character budget across descriptions in round-robin order. - Fall back to omitting entries only when the minimum catalog cannot fit. ## Testing Added extension and production-turn coverage that verifies moderate budget pressure keeps every catalog entry, shortens descriptions evenly, and avoids an omission marker. GitOrigin-RevId: 41971e4b47a86863b3839707b5cffcd8d83b888c
This commit is contained in:
1 parent
667b6bbaf1
commit
6278742c41
4 files changed
+384
-43
No files matched your search
@@ -149,13 +149,15 @@ fn character_fallback_counts_multibyte_metadata_by_characters() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn catalog_emits_omission_marker_when_every_skill_exceeds_budget() {
|
||||
fn catalog_emits_omission_marker_when_every_minimum_skill_line_exceeds_budget() {
|
||||
let oversized = entry(
|
||||
"oversized",
|
||||
&"x".repeat(MAX_CATALOG_SKILL_DESCRIPTION_CHARS),
|
||||
/*short_description*/ None,
|
||||
)
|
||||
.with_display_path(format!("skill://{}", "x".repeat(512)));
|
||||
let catalog = SkillCatalog {
|
||||
entries: vec![entry(
|
||||
"oversized",
|
||||
&"x".repeat(MAX_CATALOG_SKILL_DESCRIPTION_CHARS),
|
||||
/*short_description*/ None,
|
||||
)],
|
||||
entries: vec![oversized],
|
||||
warnings: Vec::new(),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user