Skip to content

Sync local plugin imports, async remote imports, refresh caches after…#18246

Merged
alexsong-oai merged 10 commits intomainfrom
alexs/import-notification
Apr 17, 2026
Merged

Sync local plugin imports, async remote imports, refresh caches after…#18246
alexsong-oai merged 10 commits intomainfrom
alexs/import-notification

Conversation

@alexsong-oai
Copy link
Copy Markdown
Collaborator

@alexsong-oai alexsong-oai commented Apr 17, 2026

… import

Why

externalAgentConfig/import used to spawn plugin imports in the background and return immediately. That meant local marketplace imports could still be in flight when the caller refreshed plugin state, so newly imported plugins would not show up right away.

This change makes local marketplace imports complete before the RPC returns, while keeping remote marketplace imports asynchronous so we do not block on remote fetches.

What changed

  • split plugin migration details into local and remote marketplace imports based on the external config source
  • import local marketplaces synchronously during externalAgentConfig/import
  • return pending remote plugin imports to the app-server so it can finish them in the background
  • clear the plugin and skills caches before responding to plugin imports, and again after background remote imports complete, so the next plugin/list reloads fresh state
  • keep marketplace source parsing encapsulated behind is_local_marketplace_source(...) instead of re-exporting the internal enum
  • add core and app-server coverage for the synchronous local import path and the pending remote import path

Verification

  • cargo test -p codex-app-server-protocol
  • cargo test -p codex-core (currently fails an existing unrelated test: config_loader::tests::cli_override_can_update_project_local_mcp_server_when_project_is_trusted)
  • cargo test (currently fails existing codex-app-server integration tests in MCP/skills/thread-start areas, plus the unrelated codex-core failure above)

@alexsong-oai alexsong-oai requested a review from xl-openai April 17, 2026 01:07
@alexsong-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

);
return;
}
ServerNotification::ExternalAgentConfigImportCompleted(_) => {
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.

FYI @xl-openai, adding a notification when import completed and refresh the plugins state on TUI

@alexsong-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@alexsong-oai alexsong-oai enabled auto-merge (squash) April 17, 2026 04:15
@alexsong-oai alexsong-oai merged commit 20b4b80 into main Apr 17, 2026
34 of 36 checks passed
@alexsong-oai alexsong-oai deleted the alexs/import-notification branch April 17, 2026 09:34
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 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