Repository navigation
Description
Description
The resolve_plugin_source_path() function in codex-rs/core/src/plugins/marketplace.rs rejects every form of local plugin source path that resolves to the repository root directory (the marketplace root itself). This makes it impossible to register a plugin whose .codex-plugin/plugin.json and skills live at the top level of the repository.
This may be by design, but supporting "./" as a reference to the repo root is a natural use case — particularly for monorepos that keep a single top-level .codex-plugin/plugin.json alongside an existing skills/ directory.
Steps to reproduce
Directory layout:
<repo>/
.agents/plugins/marketplace.json
.codex-plugin/plugin.json
skills/
marketplace.json:
{
"name": "my-plugins",
"interface": { "displayName": "My plugins" },
"plugins": [
{
"name": "repo-root-plugin",
"source": { "source": "local", "path": "./" },
"policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" },
"category": "productivity"
}
]
}Result: The marketplace fails to load.
Every path variation that should resolve to the repo root is rejected:
| `path` value | Error |
|---|---|
| `"./"` | `local plugin source path must not be empty` |
| `"."` | `local plugin source path must start with './'` |
| `"././"` | `local plugin source path must stay within the marketplace root` |
| `"./plugins/../"` | `local plugin source path must stay within the marketplace root` |
Log output in `~/.codex/log/codex-tui.log`:
WARN codex_core::plugins::marketplace: skipping marketplace that failed to load
path=<repo>/.agents/plugins/marketplace.json
error=invalid marketplace file \`<repo>/.agents/plugins/marketplace.json\`: local plugin source path must not be empty
Root cause
The validation in `resolve_plugin_source_path()` (marketplace.rs L338-374) applies three sequential checks after stripping the `"./"` prefix:
- Check 1 (L344): `path.strip_prefix("./")` — input must start with `"./"`. Rejects `"."`.
- Check 2 (L350): The remainder after stripping must not be empty. Rejects `"./"` because `"./".strip_prefix("./")` yields `""`.
- Check 3 (L358-360): All `Path::components()` must be `Component::Normal`. Rejects `"././"` (contains `CurDir`) and `"./plugins/../"` (contains `ParentDir`).
The function always requires at least one `Normal` path component, so the resolved path is always a strict subdirectory of the marketplace root. No valid `path` value can reference the root itself.
Proposed change
Treat an empty remainder (after stripping `"./"`) as a valid path that resolves to the marketplace root:
RawMarketplaceManifestPluginSource::Local { path } => {
let Some(path) = path.strip_prefix("./") else {
return Err(/* "must start with \`./\`" */);
};
// "./" means the marketplace root itself.
if path.is_empty() {
return Ok(marketplace_root_dir(marketplace_path)?);
}
let relative_source_path = Path::new(path);
if relative_source_path
.components()
.any(|component| !matches!(component, Component::Normal(_)))
{
return Err(/* "must stay within the marketplace root" */);
}
Ok(marketplace_root_dir(marketplace_path)?.join(relative_source_path))
}Current workarounds
A. Place the plugin in a subdirectory and symlink to the repo-root skills:
.codex/plugins/my-plugin/
.codex-plugin/plugin.json
skills -> ../../../skills # symlink
{ "source": { "source": "local", "path": "./.codex/plugins/my-plugin" } }This works but adds indirection and fragile symlinks that may break on some platforms.
B. Set "path": "../.." in .agents/plugins/marketplace.json
{
"name": "ecc",
"interface": {
"displayName": "Everything Claude Code"
},
"plugins": [
{
"name": "ecc",
"source": {
"source": "local",
"path": "../.."
},
...
}
]
}This works but introduces undesirable reference to the ancestor directories of the repository root.
Environment
- Codex CLI: main branch at `80ebc80be`
- OS: macOS (Darwin 25.4.0)
Comparison with Claude Code Marketplace/Plugins
Claude Code marketplace configs do permit a local plugin source path ./, allowing bundling the repo root /skills/ in a repo root Claude Code plugin:
<repo>/
.claude-plugin/
marketplace.json
plugin.json
skills/
Example:
{
"name": "ecc",
...
"plugins": [
{
"name": "ecc",
"source": "./",
...
}
]
}{
"name": "ecc",
...
"skills": ["./skills/"],
...
}Proposed Changes
A possible change to relax the restrictions with respect to the local plugin path in the marketplace config:
https://github.com/openai/codex/compare/main...mmizutani:codex:fix/marketplace-root-plugin-path?expand=1
Activity
github-actions commentedon Apr 8, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
rayjasson98 commentedon Apr 29, 2026
Thanks for documenting this. Unfortunately, neither workaround works for me. I still have to create a dedicated plugin folder based on Codex docs. Is there a reason Codex doesn’t follow the same convention as Claude?
Revert marketplace path to ../.. — './' is rejected by Codex
docs: switch Codex install to Symlink mode (workaround #17066) + migr…
heliusjing commentedon May 11, 2026
I also encountered this problem.
feat: add Codex marketplace catalog at .agents/plugins/ (#1) (#6)
fix(codex): remove malformed .agents/plugins/marketplace.json
fix(ci): npm ci, Gemini non-interactive flags, document Codex limitation
refactor: drop Codex support — same logic that removed Gemini
feat: scaffold the commercetools plugin for AI coding agents (#1)
feat: ship handoff-mcp as a Codex plugin (#7)
1 remaining item
feat: native plugins for Cursor, Codex CLI, Kiro, and OpenCode (#77)
feat: re-add OpenAI Codex as a supported vendor (#4)
Restructure into plugins/estack: ship as a Codex + Claude Code plugin
[T-VENDOR-SYNC] add plugins/hopper drift guard (sync script + CI test)
feat: add marketplace.json so the repo is codex plugin marketplace ad…
feat(e2e-reviewer): v1.5.6 scanner fixes, README/roadmap, audit bump
caseychow-oai commentedon Jun 17, 2026
Fix PR opened: #28771
caseychow-oai commentedon Jun 17, 2026
Updated fix PR: #28771
Final behavior accepts repo-root local plugin paths
.and./, keeps""invalid, and still rejects non-normal/traversal paths like././,./plugins/../, and../....caseychow-oai commentedon Jun 17, 2026
Merged: #28771
The root-local marketplace fix is now landed.
Sent from my Codex
caseychow-oai commentedon Jun 17, 2026
Per my Codex slop above 😅 this should be addressed in the next cut!
sophio-japharidze-sonarsource commentedon Jun 18, 2026
Did the fix work for you @mmizutani ? I still face an issue - it's adding the marketplace but it does not appear inside Codex session, and the plugin also is not being listed. 🤔
EDIT: I was testing on v0.141.0, and it does not yet include the fix! Sorry about that
mmizutani commentedon Jun 23, 2026
@sophio-japharidze-sonarsource
The fix #28771 has been released in v0.142.0.
fix: address code review findings
chore: add LICENSE, align author metadata, note Codex marketplace sup…