summaryrefslogtreecommitdiff
path: root/tests/codex
AgeCommit message (Collapse)Author
2026-10-23fix(codex): accept linked git worktrees as checkoutsfix/codex-scripts-in-worktreesJesse Vincent
package-codex-plugin.sh and sync-to-codex-plugin.sh checked for a checkout with [[ -d .git ]]. In a linked worktree .git is a file, so both scripts died with "not a git checkout" there, and tests/codex/test-package-codex-plugin.sh failed 9 checks when run from any worktree. Test that .git exists instead: it covers both layouts and still requires the path to be the root of a checkout, which matters for sync's user-supplied --local path. The scripts' later git commands already work in worktrees. Regression tests run the package script from a linked worktree of the repo, and a sync preview from a linked upstream worktree into a linked destination worktree. The package test is adapted from #1910. Co-authored-by: tianma-if <tianma-if@users.noreply.github.com> Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
2026-07-19fix(codex): make package script and its test portable beyond macOS/bsdtarJesse Vincent
The packaging pipeline only worked on a Mac with default umask, for three stacked reasons: - The deterministic-metadata tar flags (--uid/--gid/--uname/--gname) are bsdtar spellings; GNU tar rejects them, so the tar.gz archive step died on Linux. Detect the tar flavor and use --owner=:0 --group=:0 --numeric-owner on GNU tar, which writes byte-identical ustar headers (uid/gid 0, empty uname/gname). - Staged file modes depended on two umasks canceling out: git archive masks entry modes with tar.umask (git default 0002 -> 775), and the unflagged tar extraction re-masked with the process umask (022 on macOS -> 755, but 002 elsewhere -> 775). Pin tar.umask=0022 on the archive call and extract with -p so staged modes are canonical 755/644 on every machine. - The test's timestamp assertion parsed bsdtar's -tv column layout and expected epoch 0 rendered in a US timezone ("Dec 31 1969"); GNU tar uses different columns and UTC hosts render "1970-01-01". Assert mtime == 0 via python3 tarfile instead, matching how the test already checks zip timestamps. tests/codex/test-package-codex-plugin.sh now passes on Linux/GNU tar; the bsdtar branch preserves the exact flags that passed on macOS.
2026-07-02Preserve hooks in Codex package manifestDrew Ritter
2026-07-02Strip hooks from Codex portal packageDrew Ritter
2026-07-02Default Codex portal package to zipDrew Ritter
2026-07-02Harden Codex package script checksDrew Ritter
2026-07-02Add Codex portal package scriptDrew Ritter
2026-07-02fix(codex): suppress SessionStart hook auto-discovery with empty hooks objectDrew Ritter
Codex auto-discovers a plugin's hooks/hooks.json whenever the Codex manifest has no `hooks` field: load_plugin_hooks falls back to a hardcoded DEFAULT_HOOKS_CONFIG_FILE = "hooks/hooks.json" and registers it. hooks/hooks.json is the Claude Code SessionStart hook, it is tracked in this repo, and the Codex marketplace installs the whole repo root (source url "./"), so the fallback re-registered the SessionStart hook and its install-time trust prompt on Codex. Removing the Codex hook file and the manifest `hooks` pointer (commit "Remove Codex hooks") did not disable the hook on Codex — it removed the explicit declaration that was overriding the fallback, so the fallback took over and found the Claude hooks/hooks.json. Declare an empty inline hooks object ({}) in .codex-plugin/plugin.json. It parses as an empty inline hook set and stops Codex reaching the auto-discovery fallback. An absent field, an empty array ([]), and an empty inline list all collapse back to the fallback, so the value must be exactly {}. Update the test to assert the manifest declares hooks: {} (and that hooks/hooks.json exists, which is what makes the declaration necessary), replacing the prior assertion that the field was absent — which passed while the hook was still being auto-discovered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30test(codex): assert Codex manifest ships no hooksJesse Vincent
Commit 1f0c76e removed the Codex SessionStart hook — dropping the hooks field from .codex-plugin/plugin.json and deleting hooks-codex.json — but left test-marketplace-manifest.sh asserting the old hooks pointer, so the test has failed on dev since. Assert the field is absent instead, locking in the no-Codex-hooks decision.
2026-06-30Keep Codex hooks manifest in plugin metadataJesse Vincent
Prompt: Jesse questioned whether the PR should remove the hooks config from the Codex plugin manifest. Runtime investigation showed Codex accepts a committed plugin manifest with hooks and installs the plugin successfully. Removing the field changes behavior: Codex falls back to the default hooks/hooks.json, which uses the non-Codex session-start hook and CLAUDE_PLUGIN_ROOT path, instead of hooks/hooks-codex.json and the session-start-codex script. Changes: restore .codex-plugin/plugin.json hooks to ./hooks/hooks-codex.json and update the Codex marketplace manifest test to require that Codex-specific hook pointer instead of rejecting hooks. Validation: bash tests/codex/test-marketplace-manifest.sh; scripts/lint-shell.sh tests/codex/test-marketplace-manifest.sh; bash tests/codex-plugin-sync/test-sync-to-codex-plugin.sh; bash tests/kimi/test-plugin-manifest.sh; bash tests/shell-lint/test-lint-shell.sh.
2026-06-30Add Codex marketplace manifestJesse Vincent
Prompt: Jesse asked for a new worktree off the local superpowers dev branch to add the Codex manifest after diagnosing why github.com/obra/superpowers did not show installable Codex plugins. Root cause: Codex marketplace sources expect a .agents/plugins/marketplace.json at the marketplace root. The superpowers repo only had the Claude marketplace file and the Codex plugin manifest, so Codex could configure the marketplace name but found no installable plugin entries. Changes: add a repo-local Codex marketplace manifest for superpowers-dev that points at this same repository root via the same-root source pattern Codex already accepts; add a focused marketplace manifest test; remove the unsupported hooks field from .codex-plugin/plugin.json so the plugin validator accepts the manifest. Validation: bash tests/codex/test-marketplace-manifest.sh; uv run --with PyYAML python /Users/jesse/.codex/skills/.system/plugin-creator/scripts/validate_plugin.py /Users/jesse/git/superpowers/superpowers/.worktrees/codex-marketplace-manifest; throwaway HOME codex plugin marketplace add/list/add; bash tests/codex-plugin-sync/test-sync-to-codex-plugin.sh; bash tests/kimi/test-plugin-manifest.sh; bash tests/shell-lint/test-lint-shell.sh; scripts/lint-shell.sh tests/codex/test-marketplace-manifest.sh.