mirror of
https://github.com/openai/codex.git
synced 2026-10-29 00:06:55 +00:00
Emit host skill budget warnings from world state (#35766)
## Why Host skill catalogs supplied through extension world state should report budget warnings only when their catalog update is actually rendered. ## What changed - Stop rebuilding an extension-owned host catalog in core. - Emit host catalog budget warnings when the corresponding world-state fragment is rendered, and deduplicate them with executor catalog warnings. - Cover full, shortened, and omitted host and executor catalogs, including repeated turns and resumed persisted snapshots. GitOrigin-RevId: ba28b6e337281b49ed4da2175c193fd4a6898ab7
This commit is contained in:
@@ -3376,22 +3376,18 @@ impl Session {
|
||||
{
|
||||
developer_sections.push(developer_instructions.to_string());
|
||||
}
|
||||
if turn_context.config.include_skill_instructions {
|
||||
let host_catalog_in_world_state = turn_context
|
||||
if turn_context.config.include_skill_instructions
|
||||
&& turn_context
|
||||
.extension_data
|
||||
.get::<HostSkillsCatalogInWorldState>()
|
||||
.is_some();
|
||||
let side_effects = if host_catalog_in_world_state {
|
||||
SkillRenderSideEffects::None
|
||||
} else {
|
||||
SkillRenderSideEffects::ThreadStart {
|
||||
session_telemetry: &self.services.session_telemetry,
|
||||
}
|
||||
};
|
||||
.is_none()
|
||||
{
|
||||
let available_skills = build_available_skills(
|
||||
turn_context.turn_skills.snapshot.outcome(),
|
||||
default_skill_metadata_budget(turn_context.model_info.context_window),
|
||||
side_effects,
|
||||
SkillRenderSideEffects::ThreadStart {
|
||||
session_telemetry: &self.services.session_telemetry,
|
||||
},
|
||||
);
|
||||
if let Some(available_skills) = available_skills {
|
||||
let warning_message = available_skills.warning_message.clone();
|
||||
@@ -3408,9 +3404,7 @@ impl Session {
|
||||
})
|
||||
.await;
|
||||
}
|
||||
if !host_catalog_in_world_state {
|
||||
developer_sections.push(skills_instructions.render());
|
||||
}
|
||||
developer_sections.push(skills_instructions.render());
|
||||
}
|
||||
}
|
||||
let loaded_plugins = self
|
||||
|
||||
Reference in New Issue
Block a user