Skip to content

Auto-upgrade configured marketplaces#17425

Merged
xli-oai merged 5 commits intomainfrom
xli-codex/marketplace-auto-upgrade
Apr 16, 2026
Merged

Auto-upgrade configured marketplaces#17425
xli-oai merged 5 commits intomainfrom
xli-codex/marketplace-auto-upgrade

Conversation

@xli-oai
Copy link
Copy Markdown
Contributor

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

Summary

  • Add best-effort auto-upgrade for user-configured Git marketplaces recorded in config.toml.
  • Track the last activated Git revision with last_revision so unchanged marketplace sources skip clone work.
  • Trigger the upgrade from plugin startup and plugin/list, while preserving existing fail-open plugin behavior with warning logs rather than new user-visible errors.

Details

  • Remote configured marketplaces use git ls-remote to compare the source/ref against the recorded revision.
  • Upgrades clone into a staging directory, validate that .agents/plugins/marketplace.json exists and that the manifest name matches the configured marketplace key, then atomically activate the new root.
  • Local .agents/plugins/marketplace.json marketplaces remain live filesystem state and are not auto-pulled.
  • Existing non-curated plugin cache refresh is kicked after successful marketplace root upgrades.

Validation

  • just write-config-schema
  • cargo test -p codex-core marketplace_upgrade
  • cargo check -p codex-cli -p codex-app-server
  • just fix -p codex-core

Did not run the complete cargo test suite because the repo instructions require asking before a full core workspace run.

@etraut-openai etraut-openai added the oai PRs contributed by OpenAI employees label Apr 11, 2026
@xli-oai xli-oai force-pushed the xli-codex/marketplace-auto-upgrade branch from cc7457d to feb4d8c Compare April 13, 2026 10:13
@xli-oai xli-oai marked this pull request as ready for review April 13, 2026 19:00
@xli-oai xli-oai requested a review from xl-openai April 13, 2026 19:11
Comment thread codex-rs/core/src/plugins/manager.rs Outdated
) {
if config.features.enabled(Feature::Plugins) {
self.start_curated_repo_sync();
self.maybe_start_configured_marketplace_upgrade_for_config(config);
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.

You can move this into maybe_start_plugin_startup_tasks_for_config

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.

Addressed in 72b4885e4 by folding the configured marketplace auto-upgrade startup directly into maybe_start_plugin_startup_tasks_for_config, so that extra single-use helper is gone.

Comment thread codex-rs/core/src/plugins/manager.rs Outdated
}
}

pub fn maybe_start_non_curated_plugin_cache_refresh_for_roots(
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.

I’d prefer not to introduce a thin wrapper like this

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.

Addressed in 72b4885e4 by removing the thin force_reinstall wrapper and calling the mode-bearing refresh helper directly from the upgrade path.

@xli-oai xli-oai force-pushed the xli-codex/marketplace-auto-upgrade branch 4 times, most recently from 2d073ba to e3d017d Compare April 14, 2026 23:29
@xli-oai
Copy link
Copy Markdown
Contributor Author

xli-oai commented Apr 14, 2026

@codex review

@xli-oai xli-oai force-pushed the xli-codex/marketplace-auto-upgrade branch 14 times, most recently from a7b4304 to ddec0a3 Compare April 16, 2026 01:06
@xli-oai xli-oai force-pushed the xli-codex/marketplace-auto-upgrade branch 2 times, most recently from cb642e8 to f9e6932 Compare April 16, 2026 03:36
@xli-oai xli-oai force-pushed the xli-codex/marketplace-auto-upgrade branch from b68743c to a7d128e Compare April 16, 2026 07:53
@xli-oai
Copy link
Copy Markdown
Contributor Author

xli-oai commented Apr 16, 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: a7d128ec69

ℹ️ 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 +27 to +31
let Some(first_line) = stdout.lines().next() else {
return Err("git ls-remote returned empty output for marketplace source".to_string());
};
let Some((revision, _)) = first_line.split_once('\t') else {
return Err(format!(
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 Resolve tag refs to commit SHA before revision comparison

git_remote_revision takes the first SHA from git ls-remote <source> <ref>. For annotated tags this SHA is the tag object, while clone_git_source stores rev-parse HEAD (the peeled commit) in last_revision. The mismatch makes the up-to-date check fail permanently, so tagged marketplaces are recloned/reinstalled on every auto-upgrade pass.

Useful? React with 👍 / 👎.

@xli-oai xli-oai merged commit faf4848 into main Apr 16, 2026
52 of 58 checks passed
@xli-oai xli-oai deleted the xli-codex/marketplace-auto-upgrade branch April 16, 2026 17:36
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 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.

3 participants