Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(codex): relocate plugin into subdir so the marketplace resolves it (#2782)

Maximilian Roosf00b787e1ba5
diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json
index df58e28d6..eb1f7259f 100644
--- a/.agents/plugins/marketplace.json
+++ b/.agents/plugins/marketplace.json
@@ -1,18 +1,19 @@
{
"name": "worktrunk",
"interface": {
- "displayName": "Worktrunk",
- "shortDescription": "Git worktree workflows for parallel Codex sessions.",
- "longDescription": "Use Worktrunk from Codex to manage linked worktrees, set up LLM commit workflows, configure hooks, and bundle activity markers for wt list.",
- "developerName": "Worktrunk",
- "category": "Productivity",
- "websiteURL": "https://worktrunk.dev/claude-code/"
+ "displayName": "Worktrunk"
},
"plugins": [
{
"name": "worktrunk",
- "description": "Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows. This plugin provides configuration guidance (LLM commit messages, project hooks, worktree paths) and automatic activity tracking (🤖/💬 indicators in `wt list` showing active Codex sessions).",
- "source": "./"
+ "source": {
+ "source": "local",
+ "path": "./plugins/worktrunk"
+ },
+ "policy": {
+ "installation": "AVAILABLE"
+ },
+ "category": "Productivity"
}
]
}
diff --git a/docs/content/claude-code.md b/docs/content/claude-code.md
index 459d37251..97e5af101 100644
--- a/docs/content/claude-code.md
+++ b/docs/content/claude-code.md
@@ -39,7 +39,7 @@ This configures the Worktrunk marketplace in Codex. Then run `/plugins` in Codex
To remove the marketplace entry, run `wt config plugins codex uninstall`. Already-installed plugins and global Codex hook feature flags are left unchanged.
-If activity markers do not appear after installing the plugin, Codex may be gating plugin-bundled hooks. Run `codex features list`; if `plugin_hooks` is `false`, enable it (`codex features enable plugin_hooks`), or copy this repo's `.codex-plugin/hooks/hooks.json` to `~/.codex/hooks.json`.
+If activity markers do not appear after installing the plugin, Codex may be gating plugin-bundled hooks. Run `codex features list`; if `plugin_hooks` is `false`, enable it (`codex features enable plugin_hooks`), or copy this repo's `plugins/worktrunk/hooks/hooks.json` to `~/.codex/hooks.json`.
## Configuration skill
diff --git a/.codex-plugin/plugin.json b/plugins/worktrunk/.codex-plugin/plugin.json
similarity index 95%
rename from .codex-plugin/plugin.json
rename to plugins/worktrunk/.codex-plugin/plugin.json
index e37a2a49c..78fa9a50e 100644
--- a/.codex-plugin/plugin.json
+++ b/plugins/worktrunk/.codex-plugin/plugin.json
@@ -10,7 +10,7 @@
"license": "MIT OR Apache-2.0",
"keywords": ["git", "worktree", "codex", "agent"],
"skills": "./skills/",
- "hooks": "./.codex-plugin/hooks/hooks.json",
+ "hooks": "./hooks/hooks.json",
"interface": {
"displayName": "Worktrunk",
"shortDescription": "Git worktree workflows for parallel Codex sessions.",
diff --git a/.codex-plugin/hooks/hooks.json b/plugins/worktrunk/hooks/hooks.json
similarity index 100%
rename from .codex-plugin/hooks/hooks.json
rename to plugins/worktrunk/hooks/hooks.json
diff --git a/plugins/worktrunk/skills b/plugins/worktrunk/skills
new file mode 120000
index 000000000..5dcab58e1
--- /dev/null
+++ b/plugins/worktrunk/skills
@@ -0,0 +1 @@
+../../skills
\ No newline at end of file
diff --git a/skills/worktrunk/reference/claude-code.md b/skills/worktrunk/reference/claude-code.md
index a89eb34e1..bb4792826 100644
--- a/skills/worktrunk/reference/claude-code.md
+++ b/skills/worktrunk/reference/claude-code.md
@@ -41,7 +41,7 @@ codex plugin marketplace add max-sixty/worktrunk
To remove the marketplace entry, run `wt config plugins codex uninstall`. Already-installed plugins and global Codex hook feature flags are left unchanged.
-If activity markers do not appear after installing the plugin, Codex may be gating plugin-bundled hooks. Run `codex features list`; if `plugin_hooks` is `false`, enable it (`codex features enable plugin_hooks`), or copy this repo's `.codex-plugin/hooks/hooks.json` to `~/.codex/hooks.json`.
+If activity markers do not appear after installing the plugin, Codex may be gating plugin-bundled hooks. Run `codex features list`; if `plugin_hooks` is `false`, enable it (`codex features enable plugin_hooks`), or copy this repo's `plugins/worktrunk/hooks/hooks.json` to `~/.codex/hooks.json`.
## Configuration skill
diff --git a/src/commands/config/codex.rs b/src/commands/config/codex.rs
index 5531f7c84..7b0372591 100644
--- a/src/commands/config/codex.rs
+++ b/src/commands/config/codex.rs
@@ -51,7 +51,7 @@ pub fn handle_codex_install(yes: bool) -> Result<()> {
eprintln!(
"{}",
hint_message(
- "If markers do not appear, enable Codex plugin hooks or copy .codex-plugin/hooks/hooks.json to a standard Codex hook location"
+ "If markers do not appear, enable Codex plugin hooks or copy plugins/worktrunk/hooks/hooks.json to a standard Codex hook location"
)
);
diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rs
index dd33b69d6..3ad681d70 100644
--- a/tests/integration_tests/config_show.rs
+++ b/tests/integration_tests/config_show.rs
@@ -3540,28 +3540,42 @@ fn test_plugins_codex_install_command_fails(mut repo: TestRepo, temp_home: TempD
fn test_codex_plugin_metadata_is_valid_json() {
let project_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
let plugin: serde_json::Value = serde_json::from_str(
- &fs::read_to_string(project_root.join(".codex-plugin/plugin.json")).unwrap(),
+ &fs::read_to_string(project_root.join("plugins/worktrunk/.codex-plugin/plugin.json"))
+ .unwrap(),
)
.unwrap();
// Codex discovers a marketplace's plugin list strictly from
- // <repo-root>/.agents/plugins/marketplace.json — there is no fallback to
- // the Claude .claude-plugin/marketplace.json. Without this file Codex
- // registers the marketplace but enumerates zero plugins, so the plugin is
- // uninstallable via /plugins (verified against codex-cli 0.130.0).
+ // <repo-root>/.agents/plugins/marketplace.json (no fallback to the Claude
+ // .claude-plugin/marketplace.json). Each plugin's `source` must be an
+ // object pointing at a non-empty subdirectory — codex rejects a bare or
+ // root-relative source ("local plugin source path must not be empty"), so
+ // the plugin lives in plugins/worktrunk/ rather than at the repo root.
+ // Verified end-to-end against codex-cli 0.130.0: with this layout the
+ // worktrunk marketplace surfaces in /plugins and the plugin installs;
+ // without it the marketplace registers but enumerates zero plugins.
let marketplace: serde_json::Value = serde_json::from_str(
&fs::read_to_string(project_root.join(".agents/plugins/marketplace.json")).unwrap(),
)
.unwrap();
let hooks: serde_json::Value = serde_json::from_str(
- &fs::read_to_string(project_root.join(".codex-plugin/hooks/hooks.json")).unwrap(),
+ &fs::read_to_string(project_root.join("plugins/worktrunk/hooks/hooks.json")).unwrap(),
)
.unwrap();
assert_eq!(plugin["name"], "worktrunk");
assert_eq!(plugin["skills"], "./skills/");
- assert_eq!(plugin["hooks"], "./.codex-plugin/hooks/hooks.json");
+ assert_eq!(plugin["hooks"], "./hooks/hooks.json");
assert_eq!(marketplace["plugins"][0]["name"], "worktrunk");
- assert_eq!(marketplace["plugins"][0]["source"], "./");
+ // Source is a non-empty subdir object; a bare "./" is rejected by codex.
+ assert_eq!(marketplace["plugins"][0]["source"]["source"], "local");
+ assert_eq!(
+ marketplace["plugins"][0]["source"]["path"],
+ "./plugins/worktrunk"
+ );
+ assert_eq!(
+ marketplace["plugins"][0]["policy"]["installation"],
+ "AVAILABLE"
+ );
// Codex validates `interface` is an object and requires `displayName`;
// omitting it is what made the plugin undiscoverable in /plugins.
assert_eq!(marketplace["interface"]["displayName"], "Worktrunk");
diff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_install.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_codex_install.snap
index 7d301b011..2cffee68a 100644
--- a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_install.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__plugins_codex_install.snap
@@ -14,13 +14,19 @@ info:
COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMON_DIR: ""
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_DIR: ""
GIT_EDITOR: ""
+ GIT_INDEX_FILE: ""
+ GIT_OBJECT_DIRECTORY: ""
GIT_TERMINAL_PROMPT: "0"
+ GIT_WORK_TREE: ""
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
NO_COLOR: ""
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
@@ -33,14 +39,18 @@ info:
WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_CODEX_INSTALLED: "1"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
---
success: true
@@ -52,4 +62,4 @@ exit_code: 0
✓ Codex marketplace configured
↳ Next, run /plugins in Codex and install Worktrunk from the marketplace
↳ Activity markers (🤖/💬) use Codex plugin-bundled hooks
-↳ If markers do not appear, enable Codex plugin hooks or copy .codex-plugin/hooks/hooks.json to a standard Codex hook location
+↳ If markers do not appear, enable Codex plugin hooks or copy plugins/worktrunk/hooks/hooks.json to a standard Codex hook location