mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
Use batch metadata for plugin app summaries (#34851)
## What changed - Load app metadata for plugin read and install responses through the authenticated batch API, splitting requests into batches of 100 and retaining cached metadata if a batch fails. - Preserve every declared app in plugin responses, using its ID as the fallback name and retaining categories from the plugin declaration when metadata is unavailable. - Add `isEnabled`, `disabledReason`, and `isReadOnly` to `AppToolSummary`, with defaults that keep legacy responses compatible. ## Testing - Cover plugin reads with more than 100 apps, partial batch failures, install-time authentication results, tool-state propagation, and legacy tool summaries. GitOrigin-RevId: 14000df9c5c94dde781358e292a8bef741c5dd23
This commit is contained in:
@@ -246,6 +246,12 @@ struct BatchAppToolSummary {
|
||||
name: String,
|
||||
title: Option<String>,
|
||||
description: String,
|
||||
#[serde(default)]
|
||||
is_enabled: Option<bool>,
|
||||
#[serde(default)]
|
||||
disabled_reason: Option<String>,
|
||||
#[serde(default)]
|
||||
is_read_only: bool,
|
||||
}
|
||||
|
||||
fn batch_app_to_metadata(app: BatchApp) -> ConnectorMetadata {
|
||||
@@ -273,11 +279,17 @@ fn batch_app_to_metadata(app: BatchApp) -> ConnectorMetadata {
|
||||
name,
|
||||
title,
|
||||
description,
|
||||
is_enabled,
|
||||
disabled_reason,
|
||||
is_read_only,
|
||||
} = tool;
|
||||
ConnectorToolSummary {
|
||||
name,
|
||||
title,
|
||||
description,
|
||||
is_enabled: is_enabled.unwrap_or(true),
|
||||
disabled_reason,
|
||||
is_read_only,
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
@@ -368,7 +380,11 @@ mod tests {
|
||||
"name": "Alpha",
|
||||
"description": "Alpha description",
|
||||
"icon_url": null,
|
||||
"tools": null,
|
||||
"tools": [{
|
||||
"name": "search",
|
||||
"title": "Search",
|
||||
"description": "Search Alpha",
|
||||
}],
|
||||
}))
|
||||
.expect("valid legacy batch app");
|
||||
|
||||
@@ -381,7 +397,14 @@ mod tests {
|
||||
icon_url: None,
|
||||
icon_url_dark: None,
|
||||
distribution_channel: None,
|
||||
tool_summaries: None,
|
||||
tool_summaries: Some(vec![ConnectorToolSummary {
|
||||
name: "search".to_string(),
|
||||
title: Some("Search".to_string()),
|
||||
description: "Search Alpha".to_string(),
|
||||
is_enabled: true,
|
||||
disabled_reason: None,
|
||||
is_read_only: false,
|
||||
}]),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user