feat: track plugins mcps/apps and add plugin info to user_instructions (#13433)

### first half of changes, followed by #13510

Track plugin capabilities as derived summaries on `PluginLoadOutcome`
for enabled plugins with at least one skill/app/mcp.

Also add `Plugins` section to `user_instructions` injected on session
start. These introduce the plugins concept and list enabled plugins, but
do NOT currently include paths to enabled plugins or details on what
apps/mcps the plugins contain (current plan is to inject this on
@-mention). that can be adjusted in a follow up and based on evals.

### tests
Added/updated tests, confirmed locally that new `Plugins` section +
currently enabled plugins show up in `user_instructions`.
This commit is contained in:
sayan-oai
2026-03-04 19:46:13 -08:00
committed by GitHub
parent be5e8fbd37
commit d44398905b
7 changed files with 270 additions and 31 deletions

View File

@@ -169,6 +169,18 @@ async fn plugin_skills_append_to_instructions() -> Result<()> {
let instructions_text = request_body["input"][1]["content"][0]["text"]
.as_str()
.expect("instructions text");
assert!(
instructions_text.contains("## Plugins"),
"expected plugins section present"
);
assert!(
instructions_text.contains("### Available plugins\n- `sample`"),
"expected enabled plugin list in instructions"
);
assert!(
instructions_text.contains("### How to use plugins"),
"expected plugin usage guidance heading"
);
assert!(
instructions_text.contains("## Skills"),
"expected skills section present"
@@ -183,6 +195,10 @@ async fn plugin_skills_append_to_instructions() -> Result<()> {
instructions_text.contains(&expected_path_str),
"expected path {expected_path_str} in instructions"
);
assert!(
instructions_text.find("## Plugins") < instructions_text.find("## Skills"),
"expected plugins section before skills section"
);
Ok(())
}