Skip to content

[codex] Add marketplace remove command and shared logic#17752

Merged
xli-oai merged 5 commits intomainfrom
xli-codex/marketplace-remove-shared
Apr 18, 2026
Merged

[codex] Add marketplace remove command and shared logic#17752
xli-oai merged 5 commits intomainfrom
xli-codex/marketplace-remove-shared

Conversation

@xli-oai
Copy link
Copy Markdown
Contributor

@xli-oai xli-oai commented Apr 14, 2026

Summary

Move the marketplace remove implementation into shared core logic so both the CLI command and follow-up app-server RPC can reuse the same behavior.

This change:

  • adds a shared codex_core::plugins::remove_marketplace(...) flow
  • moves validation, config removal, and installed-root deletion out of the CLI
  • keeps the CLI as a thin wrapper over the shared implementation
  • adds focused core coverage for the shared remove path

Validation

  • just fmt
  • focused local coverage for the shared remove path
  • heavier follow-up validation deferred to stacked PR CI

@xli-oai xli-oai added the oai PRs contributed by OpenAI employees label Apr 14, 2026 — with ChatGPT Codex Connector
@xli-oai xli-oai changed the title [codex] Refactor marketplace/remove for shared core use [codex] Add marketplace remove command and shared logic Apr 14, 2026
@xli-oai
Copy link
Copy Markdown
Contributor Author

xli-oai commented Apr 17, 2026

@codex review

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: 856511e999

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

Comment thread codex-rs/core/src/plugins/marketplace_remove.rs
Comment on lines +68 to +69
if !root.exists() {
return Ok(None);
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.

P2 Badge Check install-root existence with try_exists

remove_marketplace_root uses Path::exists(), which returns false on metadata errors (e.g. permission denied). That path is then treated as “not installed”, and removal may still report success after config edit, leaving undeleted marketplace files. Use try_exists() and surface I/O errors instead of silently skipping removal.

Useful? React with 👍 / 👎.

Comment thread codex-rs/core/src/plugins/marketplace_remove.rs Outdated
Comment thread codex-rs/core/src/plugins/marketplace_remove.rs
Comment on lines +68 to +69
if !root.exists() {
return Ok(None);
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.

P2 Badge Use try_exists when checking install root presence

remove_marketplace_root uses Path::exists(), which returns false on metadata errors (for example, permission denied). The command can then skip deletion and still report success after config removal, leaving marketplace files behind. Use try_exists() so I/O failures are surfaced as errors instead of being treated as “not installed”.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will be a todo, very unlikely

Comment thread codex-rs/core/src/plugins/marketplace_remove.rs Outdated
Comment thread codex-rs/core/src/plugins/marketplace_remove.rs
Comment thread codex-rs/core/src/plugins/marketplace_remove.rs Outdated
Comment thread codex-rs/config/src/marketplace_edit.rs Outdated
@xli-oai
Copy link
Copy Markdown
Contributor Author

xli-oai commented Apr 18, 2026

@codex review

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: e53c56038d

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

Comment on lines +77 to +78
if !root.exists() {
return Ok(None);
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.

P2 Badge Handle dangling symlink roots when removing marketplaces

remove_marketplace_root checks root.exists() before symlink_metadata. exists() follows symlinks, so a dangling symlink under .tmp/marketplaces/<name> is treated as missing and never removed. This leaves corrupt install entries behind, and removal can incorrectly return "not configured or installed" when only a broken symlink remains.

Useful? React with 👍 / 👎.

@xli-oai xli-oai merged commit e9c70ff into main Apr 18, 2026
35 of 36 checks passed
@xli-oai xli-oai deleted the xli-codex/marketplace-remove-shared branch April 18, 2026 04:44
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants