summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDrew Ritter <drew@primeradiant.com>2026-06-30 15:57:52 -0700
committerJesse Vincent <jesse@fsck.com>2026-07-02 14:56:55 -0700
commit28b96af905dbb9d5f2b7a2df3030ba860858ef2d (patch)
tree92a7df765e43b332f7e8664788a00a30123ac8cd /tests
parent4572974c46315b9070bd1c211a1d06a0a4f59842 (diff)
chore(codex): remove orphaned session-start-codex hook + refresh hook docs
hooks/session-start-codex has had no caller since "Remove Codex hooks" (#1845) deleted hooks-codex.json and its manifest registration; the Codex manifest now declares an empty hooks object so Codex registers no session-start hook at all. The script is Codex-specific dead code — nothing executes it on Codex or any other harness. - Delete hooks/session-start-codex. - tests/hooks/test-session-start.sh: drop the two Codex cases that are redundant with the generic session-start tests (nested-format and the legacy-warning omission are already covered by the Claude Code cases). Re-point the "wrapper dispatches" case to the live `session-start` script so run-hook.cmd dispatch coverage — used by Claude Code and Cursor in production — is preserved rather than lost. - docs/porting-to-a-new-harness.md: Codex is no longer a Shape A (shell-hook) harness, so re-anchor that worked example to Cursor (a live shell-hook harness that demonstrates the same per-harness field, schema, and matcher variance) and mark Codex as native skill discovery with no session-start hook. Clears the references to the deleted hooks-codex.json. - docs/windows/polyglot-hooks.md: the "check hooks-codex.json" pointer referenced a file deleted in #1845; re-point to hooks-cursor.json. RELEASE-NOTES.md keeps its historical mention of hooks-codex.json (it accurately records what that release did). The tests/codex-plugin-sync fixtures build their own synthetic session-start-codex and test the sync mechanism generically, so they are intentionally left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/hooks/test-session-start.sh44
1 files changed, 4 insertions, 40 deletions
diff --git a/tests/hooks/test-session-start.sh b/tests/hooks/test-session-start.sh
index 989d72c..b027f3c 100755
--- a/tests/hooks/test-session-start.sh
+++ b/tests/hooks/test-session-start.sh
@@ -4,7 +4,6 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
HOOK_UNDER_TEST="$REPO_ROOT/hooks/session-start"
-CODEX_HOOK_UNDER_TEST="$REPO_ROOT/hooks/session-start-codex"
WRAPPER_UNDER_TEST="$REPO_ROOT/hooks/run-hook.cmd"
FAILURES=0
@@ -154,35 +153,15 @@ assert_command_output \
CLAUDE_PLUGIN_ROOT="$REPO_ROOT" \
bash "$HOOK_UNDER_TEST"
-codex_home="$(make_home codex-plugin-hooks)"
-codex_data="$TEST_ROOT/codex-plugin-hooks/data"
-mkdir -p "$codex_data"
+wrapper_home="$(make_home run-hook-wrapper)"
assert_command_output \
- "Codex plugin hooks use dedicated script and emit nested SessionStart additionalContext" \
+ "run-hook.cmd wrapper dispatches to the named session-start script" \
"nested" \
"" \
"" \
- "$codex_home" \
- PLUGIN_DATA="$codex_data" \
- CLAUDE_PLUGIN_DATA="$codex_data" \
- PLUGIN_ROOT="$REPO_ROOT" \
+ "$wrapper_home" \
CLAUDE_PLUGIN_ROOT="$REPO_ROOT" \
- bash "$CODEX_HOOK_UNDER_TEST"
-
-codex_wrapper_home="$(make_home codex-wrapper)"
-codex_wrapper_data="$TEST_ROOT/codex-wrapper/data"
-mkdir -p "$codex_wrapper_data"
-assert_command_output \
- "Codex wrapper path dispatches to dedicated script" \
- "nested" \
- "" \
- "" \
- "$codex_wrapper_home" \
- PLUGIN_DATA="$codex_wrapper_data" \
- CLAUDE_PLUGIN_DATA="$codex_wrapper_data" \
- PLUGIN_ROOT="$REPO_ROOT" \
- CLAUDE_PLUGIN_ROOT="$REPO_ROOT" \
- bash "$WRAPPER_UNDER_TEST" session-start-codex
+ bash "$WRAPPER_UNDER_TEST" session-start
cursor_home="$(make_home cursor)"
assert_command_output \
@@ -217,21 +196,6 @@ assert_command_output \
CLAUDE_PLUGIN_ROOT="$REPO_ROOT" \
bash "$HOOK_UNDER_TEST"
-codex_legacy_home="$(make_home codex-legacy-warning-removed)"
-codex_legacy_data="$TEST_ROOT/codex-legacy-warning-removed/data"
-mkdir -p "$codex_legacy_home/.config/superpowers/skills" "$codex_legacy_data"
-assert_command_output \
- "Codex SessionStart omits obsolete legacy custom-skill warning" \
- "nested" \
- "" \
- "Superpowers now uses"$'\037'"~/.config/superpowers/skills"$'\037'"~/.claude/skills"$'\037'"legacy" \
- "$codex_legacy_home" \
- PLUGIN_DATA="$codex_legacy_data" \
- CLAUDE_PLUGIN_DATA="$codex_legacy_data" \
- PLUGIN_ROOT="$REPO_ROOT" \
- CLAUDE_PLUGIN_ROOT="$REPO_ROOT" \
- bash "$CODEX_HOOK_UNDER_TEST"
-
if [[ "$FAILURES" -gt 0 ]]; then
echo "STATUS: FAILED ($FAILURES failure(s))"
exit 1