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
2026-07-17 16:10:50 +00:00
committed by copyberry
parent e0ac6d0ec9
commit 20465d30ae
4 changed files with 74 additions and 10 deletions
+4 -2
View File
@@ -95,9 +95,11 @@ fn build_multi_agent_mode_update_item(
}
match effective_multi_agent_mode {
Some(multi_agent_mode) => Some(MultiAgentModeInstructions::new(multi_agent_mode).render()),
Some(multi_agent_mode) => MultiAgentModeInstructions::from_mode(multi_agent_mode)
.map(|instructions| instructions.render()),
None if previous.multi_agent_mode == Some(MultiAgentMode::Proactive) => {
Some(MultiAgentModeInstructions::new(MultiAgentMode::ExplicitRequestOnly).render())
MultiAgentModeInstructions::from_mode(MultiAgentMode::ExplicitRequestOnly)
.map(|instructions| instructions.render())
}
None => None,
}