Omit empty app-server instruction overrides (#17258)

## Summary
- omit serialized Responses instructions when an app-server base
instruction override is empty
- skip empty developer instruction messages and add v2 coverage for the
empty-override request shape

## Validation
- just fmt
- git diff --check
This commit is contained in:
Ahmed Ibrahim
2026-04-09 15:29:35 -07:00
committed by GitHub
parent ff1ab61e4f
commit ecca34209d
3 changed files with 95 additions and 0 deletions
+2
View File
@@ -3746,6 +3746,7 @@ impl Session {
// stays isolated as its own top-level developer message for guardian subagents.
if !separate_guardian_developer_message
&& let Some(developer_instructions) = turn_context.developer_instructions.as_deref()
&& !developer_instructions.is_empty()
{
developer_sections.push(developer_instructions.to_string());
}
@@ -3860,6 +3861,7 @@ impl Session {
// subagent sees a distinct, easy-to-audit instruction block.
if separate_guardian_developer_message
&& let Some(developer_instructions) = turn_context.developer_instructions.as_deref()
&& !developer_instructions.is_empty()
&& let Some(guardian_developer_message) =
crate::context_manager::updates::build_developer_update_item(vec![
developer_instructions.to_string(),