feat: Allow sync with remote plugin status. (#14176)

Add forceRemoteSync to plugin/list.
When it is set to True, we will sync the local plugin status with the
remote one (backend-api/plugins/list).
This commit is contained in:
xl-openai
2026-03-10 13:32:59 -07:00
committed by Michael Bolin
parent f2d66fadd8
commit d751e68f44
14 changed files with 1042 additions and 30 deletions

View File

@@ -2820,6 +2820,10 @@ pub struct PluginListParams {
/// only home-scoped marketplaces and the official curated marketplace are considered.
#[ts(optional = nullable)]
pub cwds: Option<Vec<AbsolutePathBuf>>,
/// When true, reconcile the official curated marketplace against the remote plugin state
/// before listing marketplaces.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub force_remote_sync: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
@@ -2827,6 +2831,7 @@ pub struct PluginListParams {
#[ts(export_to = "v2/")]
pub struct PluginListResponse {
pub marketplaces: Vec<PluginMarketplaceEntry>,
pub remote_sync_error: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
@@ -6511,6 +6516,32 @@ mod tests {
);
}
#[test]
fn plugin_list_params_serialization_uses_force_remote_sync() {
assert_eq!(
serde_json::to_value(PluginListParams {
cwds: None,
force_remote_sync: false,
})
.unwrap(),
json!({
"cwds": null,
}),
);
assert_eq!(
serde_json::to_value(PluginListParams {
cwds: None,
force_remote_sync: true,
})
.unwrap(),
json!({
"cwds": null,
"forceRemoteSync": true,
}),
);
}
#[test]
fn codex_error_info_serializes_http_status_code_in_camel_case() {
let value = CodexErrorInfo::ResponseTooManyFailedAttempts {