Skip to content

fix(codex-action): export CLAUDE_PLUGIN_ROOT for plugin-bundled scripts - #539

Merged
max-sixty merged 1 commit into
mainfrom
codex-plugin-root
May 16, 2026
Merged

max-sixty merged 1 commit into
mainfrom
codex-plugin-root

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

Under the Codex harness, skills calling ${CLAUDE_PLUGIN_ROOT}/scripts/... (review-reviewers, review-runs, nightly) expanded to /scripts/... and failed — Claude Code sets CLAUDE_PLUGIN_ROOT natively, Codex didn't.

codex plugin add stages the tend-ci-runner plugin under $CODEX_HOME/plugins/cache/tend/tend-ci-runner/<version>/ (with scripts/ and skills/ adjacent, mirroring the source repo) and prints Installed plugin root: <path> on stdout. Parse that line, validate the directory exists, and export CLAUDE_PLUGIN_ROOT via $GITHUB_ENV so subsequent steps (including codex exec) see it. Codex's default shell_environment_policy.inherit = "all" then propagates it through to spawned shell tools unchanged.

Same variable name across harnesses — skills stay harness-agnostic. No per-skill branching, no parallel ${CODEX_PLUGIN_ROOT}. Caught as a blocker on #537.

Why parse the CLI output instead of constructing the path

The path includes the plugin version (0.1.0 today), no current symlink. Parsing codex plugin add's own announcement makes the action robust to future schema changes (version bumps, marketplace renames, cache layout) without re-engineering each time.

Test plan

  • Verified empirically against pinned @openai/[email protected]: codex plugin add tend-ci-runner@tend prints the install root, $CLAUDE_PLUGIN_ROOT/scripts/list-recent-runs.sh exists at the parsed path, parsing is idempotent on re-add.
  • pre-commit run --files codex/action.yaml passes.
  • All 230 generator tests pass.
  • CI smoke (this PR's tend-review run).

`codex plugin add` stages the tend-ci-runner plugin under
`$CODEX_HOME/plugins/cache/tend/tend-ci-runner/<version>` but doesn't
export the install path. Skills calling `${CLAUDE_PLUGIN_ROOT}/scripts/...`
(review-reviewers, review-runs, nightly) expanded to `/scripts/...` and
failed under the Codex harness — Claude Code sets the variable natively,
Codex didn't.

Parse the "Installed plugin root: <path>" line from `codex plugin add`
output and export it as `CLAUDE_PLUGIN_ROOT` via `$GITHUB_ENV`. Same
variable name across harnesses keeps skills harness-agnostic.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit f3049bf into main May 16, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex-plugin-root branch May 16, 2026 20:44
This was referenced May 16, 2026
max-sixty added a commit that referenced this pull request May 16, 2026
## Summary

Release 0.0.23. 6 commits since 0.0.22:

- #520 Cut tend's CI over to the Codex harness — tend now dogfoods Codex
- #531 fix(nightly-survey-files): print bucket/count to stderr — keep
JSON output uncontaminated
- #536 docs(claude-auth): correct June 15 2026 framing; recommend OAuth
for subscribers
- #538 **breaking:** rename default bot-token secret `BOT_TOKEN` →
`TEND_BOT_TOKEN`. Adopters using the default must add a `TEND_BOT_TOKEN`
repo secret before their next regen (or set `secrets.bot_token` in
`.config/tend.yaml` to keep using the old name)
- #539 fix(codex-action): export `CLAUDE_PLUGIN_ROOT` so plugin-bundled
scripts resolve under Codex
- #533 chore: regenerate workflows with tend 0.0.22

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.23`, PyPI publish, `uvx [email protected] --help`
works
- [ ] Regenerate tend's own workflows to `@0.0.23`

Co-authored-by: Claude <[email protected]>

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
## Summary

Release 0.0.23 — unblocks the review-reviewers Codex migration.

Since 0.0.22:
- #539 — codex-action exports `CLAUDE_PLUGIN_ROOT` so skills using
`${CLAUDE_PLUGIN_ROOT}/scripts/...` work unchanged under Codex (the
blocker on PR #537)
- #538 — `TEND_BOT_TOKEN` as the default bot-token secret name
- #540 — `install-tend --with-install-test` for pre-merge verification
- #536 — docs(claude-auth) framing for 2026-06-15
- #531 — nightly-survey-files prints bucket/count to stderr
- #520 — tend's own CI flipped to the Codex harness (live; consumer
regen moves it forward)

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.23`, PyPI publish, `uvx [email protected] --help`
works
- [ ] Regenerate main's workflows to `@0.0.23`
- [ ] Regenerate #537's codex workflows to `@0.0.23` and unblock the
review-reviewers migration

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
Routine post-release regen. Pins the 8 `tend-*.yaml` workflows to
`max-sixty/tend/[email protected]` (#539's CLAUDE_PLUGIN_ROOT export) and
switches the bot-token reference to `TEND_BOT_TOKEN` (#538).

## Test plan
- [ ] CI green (test, test-worker, lint)

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
Picks up #539's CLAUDE_PLUGIN_ROOT export so the skill's
${CLAUDE_PLUGIN_ROOT}/scripts/list-recent-runs.sh call resolves
under Codex (PR #537 blocker 1).

In Step 3's session-log download, pass both --pattern flags
('claude-session-logs*' and 'codex-session-logs*'). The target
repo's artifact prefix depends on its harness, and review-reviewers
runs across a matrix that may include either — matching both makes
the download harness-neutral without per-target branching (PR #537
blocker 2).

Co-Authored-By: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
…ts (#539)

## Summary

Under the Codex harness, skills calling
`${CLAUDE_PLUGIN_ROOT}/scripts/...` (review-reviewers, review-runs,
nightly) expanded to `/scripts/...` and failed — Claude Code sets
`CLAUDE_PLUGIN_ROOT` natively, Codex didn't.

`codex plugin add` stages the tend-ci-runner plugin under
`$CODEX_HOME/plugins/cache/tend/tend-ci-runner/<version>/` (with
`scripts/` and `skills/` adjacent, mirroring the source repo) and prints
`Installed plugin root: <path>` on stdout. Parse that line, validate the
directory exists, and export `CLAUDE_PLUGIN_ROOT` via `$GITHUB_ENV` so
subsequent steps (including `codex exec`) see it. Codex's default
`shell_environment_policy.inherit = "all"` then propagates it through to
spawned shell tools unchanged.

Same variable name across harnesses — skills stay harness-agnostic. No
per-skill branching, no parallel `${CODEX_PLUGIN_ROOT}`. Caught as a
blocker on #537.

## Why parse the CLI output instead of constructing the path

The path includes the plugin version (`0.1.0` today), no `current`
symlink. Parsing `codex plugin add`'s own announcement makes the action
robust to future schema changes (version bumps, marketplace renames,
cache layout) without re-engineering each time.

## Test plan

- [x] Verified empirically against pinned
`@openai/[email protected]`: `codex plugin add tend-ci-runner@tend`
prints the install root,
`$CLAUDE_PLUGIN_ROOT/scripts/list-recent-runs.sh` exists at the parsed
path, parsing is idempotent on re-add.
- [x] `pre-commit run --files codex/action.yaml` passes.
- [x] All 230 generator tests pass.
- [ ] CI smoke (this PR's tend-review run).

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
## Summary

Release 0.0.23. 6 commits since 0.0.22:

- #520 Cut tend's CI over to the Codex harness — tend now dogfoods Codex
- #531 fix(nightly-survey-files): print bucket/count to stderr — keep
JSON output uncontaminated
- #536 docs(claude-auth): correct June 15 2026 framing; recommend OAuth
for subscribers
- #538 **breaking:** rename default bot-token secret `BOT_TOKEN` →
`TEND_BOT_TOKEN`. Adopters using the default must add a `TEND_BOT_TOKEN`
repo secret before their next regen (or set `secrets.bot_token` in
`.config/tend.yaml` to keep using the old name)
- #539 fix(codex-action): export `CLAUDE_PLUGIN_ROOT` so plugin-bundled
scripts resolve under Codex
- #533 chore: regenerate workflows with tend 0.0.22

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.23`, PyPI publish, `uvx [email protected] --help`
works
- [ ] Regenerate tend's own workflows to `@0.0.23`

Co-authored-by: Claude <[email protected]>

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
## Summary

Release 0.0.23 — unblocks the review-reviewers Codex migration.

Since 0.0.22:
- #539 — codex-action exports `CLAUDE_PLUGIN_ROOT` so skills using
`${CLAUDE_PLUGIN_ROOT}/scripts/...` work unchanged under Codex (the
blocker on PR #537)
- #538 — `TEND_BOT_TOKEN` as the default bot-token secret name
- #540 — `install-tend --with-install-test` for pre-merge verification
- #536 — docs(claude-auth) framing for 2026-06-15
- #531 — nightly-survey-files prints bucket/count to stderr
- #520 — tend's own CI flipped to the Codex harness (live; consumer
regen moves it forward)

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.23`, PyPI publish, `uvx [email protected] --help`
works
- [ ] Regenerate main's workflows to `@0.0.23`
- [ ] Regenerate #537's codex workflows to `@0.0.23` and unblock the
review-reviewers migration

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
Routine post-release regen. Pins the 8 `tend-*.yaml` workflows to
`max-sixty/tend/[email protected]` (#539's CLAUDE_PLUGIN_ROOT export) and
switches the bot-token reference to `TEND_BOT_TOKEN` (#538).

## Test plan
- [ ] CI green (test, test-worker, lint)

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants