Skip to content

Release v6.1.1: fix Codex SessionStart hook re-registration, add Codex portal packaging - #1897

Merged
obra merged 10 commits into
mainfrom
dev
Jul 2, 2026
Merged

Release v6.1.1: fix Codex SessionStart hook re-registration, add Codex portal packaging#1897
obra merged 10 commits into
mainfrom
dev

Conversation

@obra

@obra obra commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Note on branch target: This is the v6.1.1 release integration PR (devmain),
so it targets main deliberately — releases move dev's accumulated work onto the released
branch. The template's "target dev" rule is for contributor feature PRs, not the release
cut. The diff spans dev's merge-base with main (v6.0.3), so it also re-lists the already-
released v6.1.0 commits as patch-equivalent duplicates; a rebase-merge drops those on
landing. The genuinely-new work since v6.1.0 is the nine Codex commits plus the release
commit.

Who is submitting this PR? (required)

Field Value
Your model + version Claude Opus 4.8 (claude-opus-4-8)
Harness + version Claude Code 2.1.198
All plugins installed superpowers, superpowers-dev, superpowers-chrome, superpowers-lab, superpowers-developing-for-claude-code, claude-session-driver, episodic-memory, elements-of-style, double-shot-latte, primeradiant-ops, github-triage, plugin-dev, mcp-server-dev, agent-sdk-dev, code-review, code-simplifier, pr-review-toolkit, feature-dev, frontend-design, context7, linear, claude-code-setup, security-guidance, release-radar, document-skills, example-skills, worldview-synthesis, summarize-meetings, claude-pa, claude-opus-4-5-migration, clangd/gopls/rust-analyzer/swift LSPs, cxdb-observability
Human partner who reviewed this diff Jesse Vincent

What problem are you trying to solve?

This is the v6.1.1 release of the accumulated Codex work since v6.1.0. The headline problem it fixes is a real, user-visible regression that shipped in v6.1.0:

v6.1.0's release notes said "Codex no longer ships a SessionStart hook." That was wrong in practice. Removing the Codex hook config and the manifest hooks pointer meant the Codex manifest had no hooks field — and Codex's plugin loader treats an absent hooks field as "auto-discover," falling back to a hardcoded hooks/hooks.json. That file is the Claude Code SessionStart hook, tracked in the repo, and the Codex marketplace installs the whole repo root. So v6.1.0 actually caused Codex to re-register the Claude SessionStart hook and its install-time trust prompt — the opposite of what the notes claimed.

This was found while building Codex "portal" packaging (a distributable zip/tar.gz of the Codex plugin); the packaging surfaced the same manifest-hooks question and led to the root-cause diagnosis above.

What does this PR change?

Declares an explicit empty hooks: {} object in .codex-plugin/plugin.json so Codex parses it as "no hooks" instead of hitting the auto-discovery fallback; removes the now-orphaned hooks/session-start-codex dead code and re-anchors the affected docs; and adds scripts/package-codex-plugin.sh (a deterministic Codex portal packaging script) plus its test suite. Version bumped to 6.1.1 across all seven manifests.

Is this change appropriate for the core library?

Yes. It fixes correctness of the Codex integration that ships in core (the SessionStart-hook regression affects every Codex user) and adds maintainer tooling for the core repo's own Codex distribution. It integrates no third-party service and is not project- or domain-specific.

What alternatives did you consider?

  • Empty array [] or empty inline list instead of {} — rejected: all of [], an empty inline list, and an absent field collapse back to Codex's auto-discovery fallback. Only an inline empty object {} suppresses it. This is asserted in the test.
  • Deleting hooks/hooks.json — rejected: that file is the live Claude Code / Cursor SessionStart hook. The fix has to suppress Codex's fallback without touching the hook other harnesses depend on.
  • Stripping hooks from the packaged portal manifest — tried, then reverted: the packaged manifest must keep the hooks: {} object, or a portal-installed Codex plugin hits the exact same auto-discovery bug.

Does this PR contain multiple unrelated changes?

No. Every change is Codex hook-correctness or Codex packaging — one coherent theme. As a release-integration PR it bundles the nine commits that landed on dev since v6.1.0, but they are all part of the same Codex packaging/hook-correctness effort.

Existing PRs

  • I have reviewed the commit history since v6.1.0; this is the release cut of already-reviewed dev work, not a new external contribution.
  • Related PRs: builds directly on the Codex-hook removal shipped in v6.1.0 (Remove Codex hooks #1845). This release repairs the incomplete fix from that work.

Environment tested

Harness Harness version Model Model version/ID
Claude Code 2.1.198 Claude Opus 4.8 claude-opus-4-8

Test method: the repo's shell test suites, run on macOS (darwin 25.2.0).

Evaluation

This is a release PR, not a skill/behavior change, so the verification is the test suites rather than agent evals. On the release-v6.1.1 branch, all release-relevant suites pass:

  • tests/codex/test-package-codex-plugin.sh — PASS (24 assertions: archive determinism, executable modes, OpenAI metadata, icons, dirty-worktree guard, metadata-source reproducibility, hooks: {} preserved)
  • tests/codex/test-marketplace-manifest.sh — PASS
  • tests/hooks/test-session-start.sh — PASS
  • tests/codex-plugin-sync/test-sync-to-codex-plugin.sh — PASS
  • tests/shell-lint/test-lint-shell.sh — PASS; package-codex-plugin.sh and all touched shell files are shellcheck-clean

Rigor

  • Not a skills change — no writing-skills / adversarial-eval requirement applies.
  • The package-codex-plugin.sh behavior is tested beyond the happy path (rejects dirty worktrees, rejects incomplete metadata sources, verifies archive reproducibility).
  • No carefully-tuned behavior-shaping content (Red Flags tables, rationalizations, "human partner" language) was modified.

Human review

  • A human (Jesse Vincent) reviewed the complete proposed diff before submission.

arittr and others added 10 commits July 2, 2026 14:53
…s object

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>
… 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>

@arittr arittr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@obra
obra merged commit d884ae0 into main Jul 2, 2026
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