Skip to content

[codex] Preserve remote plugin directory order#28395

Merged
jameswt-oai merged 2 commits into
mainfrom
codex/preserve-remote-plugin-directory-order
Jun 15, 2026
Merged

[codex] Preserve remote plugin directory order#28395
jameswt-oai merged 2 commits into
mainfrom
codex/preserve-remote-plugin-directory-order

Conversation

@jameswt-oai

@jameswt-oai jameswt-oai commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the plugin directory endpoint's response order while merging installed state
  • append unmatched installed-only plugins afterward when requested
  • add focused coverage for directory order and installed-only placement

Why

The remote marketplace merge currently reconstructs plugins through ordered maps and sets, then sorts the result alphabetically by display name. That discards any ordering supplied by the plugin directory endpoint before the list reaches Desktop.

Implementation

Directory plugin IDs are unique, so the merge now iterates the directory vector directly in response order. For each directory plugin, it removes matching installed state from an ID-indexed map and builds the summary. Any entries left in the installed map are installed-only plugins and are appended when include_installed_only is enabled.

There is no separate rank field, rank map, or final sort. Desktop therefore receives directory order—including any backend ranking—and can preserve it within its existing stable UI state tiers.

Testing

  • just test -p codex-core-plugins (225 passed)

@xl-openai

Copy link
Copy Markdown
Contributor

One alternative to consider: instead of recording an order map and sorting at the end, we could build the result directly in directory_plugins order, then append installed-only plugins. That might make the code a bit simpler and more explicit, but the current approach is a reasonable small fix.

@jameswt-oai
jameswt-oai marked this pull request as ready for review June 15, 2026 22:13
@jameswt-oai
jameswt-oai merged commit 4c1c9bf into main Jun 15, 2026
46 of 47 checks passed
@jameswt-oai
jameswt-oai deleted the codex/preserve-remote-plugin-directory-order branch June 15, 2026 23:09
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants