Skip to content

feat: support remote_sync for plugin install/uninstall.#14878

Merged
xl-openai merged 1 commit intomainfrom
xl/plugins3
Mar 17, 2026
Merged

feat: support remote_sync for plugin install/uninstall.#14878
xl-openai merged 1 commit intomainfrom
xl/plugins3

Conversation

@xl-openai
Copy link
Copy Markdown
Collaborator

  • Added forceRemoteSync to plugin/install and plugin/uninstall.
  • With forceRemoteSync=true, we update the remote plugin status first, then apply the local change only if the backend call succeeds.
  • Kept plugin/list(forceRemoteSync=true) as the main recon path, and for now it treats remote enabled=false as uninstall. We
    will eventually migrate to plugin/installed for more precise state handling.
@xl-openai xl-openai requested a review from sayan-oai March 17, 2026 02:52
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25175a669d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

source,
})?;
let expected_enabled = action == "enable";
if parsed.id != plugin_id {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove opaque ID equality check from mutation handling

post_remote_plugin_mutation rejects any successful response whose id differs from the requested plugin_id. But this API family already uses opaque IDs in responses (e.g., remote list fixtures use values like "1"), so a valid mutation response can be misclassified as UnexpectedPluginId. That makes forceRemoteSync installs/uninstalls fail even after backend success.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is OK.

Comment on lines +222 to +224
if !status.is_success() {
return Err(RemotePluginMutationError::UnexpectedStatus { url, status, body });
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex says the backend uninstall endpoint returns 404 when the plugin isn't installed remotely. so if you have the plugin installed locally but not remotely and call uninstall with forceRemoteSync=true, it will fail here before local removal

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is OK? ideally plugins/list will re-sync?

{
// For now, sync treats remote `enabled = false` as uninstall rather than a distinct
// disabled state.
// TODO: Switch sync to `plugins/installed` so install and enable states stay distinct.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarifying, this means new app-server endpoint?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it is a chat endpoint. we will move from calling chat plugins/list to just plugins/installed.

Copy link
Copy Markdown
Collaborator

@sayan-oai sayan-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving to unblock, but left a comment with idempotency concerns.

self.uninstall_plugin_id(plugin_id).await
}

pub async fn uninstall_plugin_with_remote_sync(
Copy link
Copy Markdown
Collaborator

@sayan-oai sayan-oai Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional nit: maybe these methods should have curated in the name, or something to clearly convey this is only with the curated plugins (we dont support remote-syncing other marketplaces, or local plugins)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually not really—we also have private plugins (with remote sync). The real question is whether desktop can support purely local plugins, which I don’t have an answer for yet.

@xl-openai xl-openai merged commit 1d85fe7 into main Mar 17, 2026
33 checks passed
@xl-openai xl-openai deleted the xl/plugins3 branch March 17, 2026 04:37
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants