mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Apply elastic entry caps to Guardian classifier evidence (#61346)
## Why Trusted classifier evidence needs to fit configured entry limits while preserving complete records and metadata that reflects only delivered reviews. ## What changed Apply elastic caps before rendering trusted tools, trusted skills, and previous reviews into developer messages. Omit oversized tool attestations and review fragments whole, retain only complete skill paths that fit, and record omissions for the request's omission notice. Keep review IDs aligned with retained fragments and preserve fixed-budget behavior. ## Testing Add coverage for whole-record omissions, retained review IDs, and omission notices. Exercise orchestrator connector evidence with both fixed budgeting and an elastic tool entry cap. GitOrigin-RevId: 729db452026f93b59765a3936730b9b6dddfcf9a
This commit is contained in:
@@ -363,28 +363,8 @@ async fn compacted_review_restores_originals_once_and_persists_the_request_prefi
|
||||
&[],
|
||||
)
|
||||
.unwrap();
|
||||
let elastic = (budgeting == ContextBudgeting::Elastic).then(|| {
|
||||
let section = codex_guardian_context::ElasticSection::TrustedSkills;
|
||||
let mut policy = codex_guardian_context::ElasticBudgetConfig::default();
|
||||
policy.sections.insert(
|
||||
section,
|
||||
codex_guardian_context::ElasticSectionLimits::new(
|
||||
/*min_total_section_tokens*/ 1, /*max_section_entry_tokens*/ 1,
|
||||
)
|
||||
.unwrap(),
|
||||
);
|
||||
let minimum = codex_guardian_context::DEFAULT_MAX_INPUT_TOKENS
|
||||
- usize::try_from(policy.total_minimum_tokens()).unwrap()
|
||||
+ 1;
|
||||
policy.sections.insert(
|
||||
section,
|
||||
codex_guardian_context::ElasticSectionLimits::new(
|
||||
minimum, /*max_section_entry_tokens*/ 1,
|
||||
)
|
||||
.unwrap(),
|
||||
);
|
||||
policy
|
||||
});
|
||||
let elastic = (budgeting == ContextBudgeting::Elastic)
|
||||
.then(core_test_support::guardian::elastic_budget_config);
|
||||
step.turn.extension_data.insert(RetainedReviewContext {
|
||||
context: context.retained_instructions(),
|
||||
elastic,
|
||||
|
||||
Reference in New Issue
Block a user