Suppress empty multi-agent mode messages (#33862)

## What changed

- Treat an empty custom `multi_agent_mode_hint_text` as having no instructions to emit.
- Avoid adding an empty multi-agent mode message both on the initial turn and when the configured hint changes after resuming a session.

## Testing

- Update the empty-hint integration test to assert that no mode message is sent.
- Add resume coverage that verifies changing a custom hint to an empty string emits no update.

GitOrigin-RevId: 8033292115936fac2cf22f85141278595804ee61
This commit is contained in:
Shijie Rao authored and copyberry committed 2026-07-17 16:10:50 +00:00
1 parent e0ac6d0ec9
commit 20465d30ae
4 files changed
+74 -10

No files matched your search

+4 -4
View File
@@ -3471,10 +3471,10 @@ impl Session {
{
items.push(usage_hint_message);
}
if let Some(multi_agent_mode) = multi_agents::effective_multi_agent_mode(turn_context) {
items.push(ContextualUserFragment::into(
MultiAgentModeInstructions::new(multi_agent_mode),
));
if let Some(multi_agent_mode) = multi_agents::effective_multi_agent_mode(turn_context)
&& let Some(instructions) = MultiAgentModeInstructions::from_mode(multi_agent_mode)
{
items.push(ContextualUserFragment::into(instructions));
}
if let Some(contextual_user_message) =
crate::context_manager::updates::build_contextual_user_message(contextual_user_sections)