-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Support featured plugins #15042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+385
−22
Merged
Support featured plugins #15042
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
39be8e1
Support featured plugins
alexsong-oai 76cb1c0
Merge branch 'main' into alexs/plugins-featured
alexsong-oai a553a10
add cache
alexsong-oai 63aa14e
fmt
alexsong-oai d0ba77e
minor
alexsong-oai 9e93805
remove unrelated
alexsong-oai 9236f69
remove py
alexsong-oai 03d7d85
revert unrelated
alexsong-oai 37487f9
minor
alexsong-oai e605d01
merge startup
alexsong-oai 9dd1676
Merge branch 'main' into alexs/plugins-featured
alexsong-oai 2e1c40c
minor
alexsong-oai 5d854d4
minor
alexsong-oai a93899c
Merge branch 'main' into alexs/plugins-featured
alexsong-oai 0d58db1
pass clone
alexsong-oai 5e275ec
fmt
alexsong-oai 1e0a7f2
fix
alexsong-oai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,6 +221,7 @@ use codex_core::models_manager::collaboration_mode_presets::CollaborationModesCo | |
| use codex_core::parse_cursor; | ||
| use codex_core::plugins::MarketplaceError; | ||
| use codex_core::plugins::MarketplacePluginSource; | ||
| use codex_core::plugins::OPENAI_CURATED_MARKETPLACE_NAME; | ||
| use codex_core::plugins::PluginInstallError as CorePluginInstallError; | ||
| use codex_core::plugins::PluginInstallRequest; | ||
| use codex_core::plugins::PluginReadRequest; | ||
|
|
@@ -424,7 +425,10 @@ impl CodexMessageProcessor { | |
| Ok(config) => self | ||
| .thread_manager | ||
| .plugins_manager() | ||
| .maybe_start_curated_repo_sync_for_config(&config), | ||
| .maybe_start_curated_repo_sync_for_config( | ||
| &config, | ||
| self.thread_manager.auth_manager(), | ||
| ), | ||
| Err(err) => warn!("failed to load latest config for curated plugin sync: {err:?}"), | ||
| } | ||
| } | ||
|
|
@@ -5409,9 +5413,9 @@ impl CodexMessageProcessor { | |
| } | ||
| }; | ||
| let mut remote_sync_error = None; | ||
| let auth = self.auth_manager.auth().await; | ||
|
|
||
| if force_remote_sync { | ||
| let auth = self.auth_manager.auth().await; | ||
| match plugins_manager | ||
| .sync_plugins_from_remote(&config, auth.as_ref()) | ||
| .await | ||
|
|
@@ -5443,8 +5447,11 @@ impl CodexMessageProcessor { | |
| }; | ||
| } | ||
|
|
||
| let config_for_marketplace_listing = config.clone(); | ||
| let plugins_manager_for_marketplace_listing = plugins_manager.clone(); | ||
| let data = match tokio::task::spawn_blocking(move || { | ||
| let marketplaces = plugins_manager.list_marketplaces_for_config(&config, &roots)?; | ||
| let marketplaces = plugins_manager_for_marketplace_listing | ||
| .list_marketplaces_for_config(&config_for_marketplace_listing, &roots)?; | ||
| Ok::<Vec<PluginMarketplaceEntry>, MarketplaceError>( | ||
| marketplaces | ||
| .into_iter() | ||
|
|
@@ -5490,12 +5497,34 @@ impl CodexMessageProcessor { | |
| } | ||
| }; | ||
|
|
||
| let featured_plugin_ids = if data | ||
| .iter() | ||
| .any(|marketplace| marketplace.name == OPENAI_CURATED_MARKETPLACE_NAME) | ||
| { | ||
| match plugins_manager | ||
| .featured_plugin_ids_for_config(&config, auth.as_ref()) | ||
| .await | ||
| { | ||
| Ok(featured_plugin_ids) => featured_plugin_ids, | ||
| Err(err) => { | ||
| warn!( | ||
| error = %err, | ||
| "plugin/list featured plugin fetch failed; returning empty featured ids" | ||
| ); | ||
| Vec::new() | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: emit failure metric |
||
| } | ||
| } | ||
| } else { | ||
| Vec::new() | ||
| }; | ||
|
|
||
| self.outgoing | ||
| .send_response( | ||
| request_id, | ||
| PluginListResponse { | ||
| marketplaces: data, | ||
| remote_sync_error, | ||
| featured_plugin_ids, | ||
| }, | ||
| ) | ||
| .await; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.