Move plugin recommendations into developer context (#47349)

## What changed

Emit `<recommended_plugins>` with the `developer` role and append it to the shared developer message after other context. Retain recognition of legacy user-role recommendations in existing rollouts.

## Testing

Add a startup context snapshot and assertions that recommendations share the developer message with permissions instructions. Update core and app-server tests to check developer-role recommendations, including across successive model requests.

GitOrigin-RevId: 0326ff347e86ec38b948f93e39e90e6a88a8730c
This commit is contained in:
Alex Daley
2026-09-22 19:51:33 +00:00
committed by copyberry
parent 5121aeff13
commit 9124e23e2c
7 changed files with 111 additions and 22 deletions
+7 -6
View File
@@ -4226,12 +4226,6 @@ impl Session {
} else {
None
};
if let Some(recommended_plugins) = recommended_plugin_candidates
.as_deref()
.and_then(RecommendedPluginsInstructions::from_plugins)
{
contextual_user_sections.push(recommended_plugins.render_fragment());
}
let context_contributors = self.services.extensions.context_contributors().to_vec();
for contributor in &context_contributors {
for fragment in contributor
@@ -4360,6 +4354,13 @@ impl Session {
}
}
if let Some(recommended_plugins) = recommended_plugin_candidates
.as_deref()
.and_then(RecommendedPluginsInstructions::from_plugins)
{
developer_sections.push(recommended_plugins.render_fragment());
}
let mut items = Vec::with_capacity(4);
if let Some(developer_message) =
crate::context_manager::updates::build_rendered_message(developer_sections)