feat: align hook lifecycle with upstream Codex (v1.5.0) - #99
Conversation
Restore the SessionEnd hook, drop the retired [features].plugin_hooks gate, and correct the review skills' request_user_input description. Co-Authored-By: Claude Code <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8da74826c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| "name": "cc-plugin-codex", | ||
| "version": "1.4.2", | ||
| "version": "1.5.0", |
There was a problem hiding this comment.
Synchronize the lockfile with the release version
This release bumps package.json to 1.5.0, but package-lock.json still declares 1.4.2 in both its top-level version and packages[""] entry. As a result, a standard npm install --package-lock-only immediately rewrites the tracked lockfile, leaving release metadata inconsistent; update those lockfile entries as part of the version bump.
Useful? React with 👍 / 👎.
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
e8da748 |
2026-08-30 00:19 UTC | 0 | 0 | 0 |
17848c2 |
2026-08-30 00:29 UTC | 0 | 0 | 0 |
5068eb8 |
2026-08-30 01:13 UTC | 0 | 0 | 0 |
df064f9 < |
2026-08-30 01:39 UTC | 0 | 0 | 0 |
Last scanned: df064f9 · 2026-08-30 01:39 UTC
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
e8da748 |
2026-08-30 00:19 UTC | 0 | 0 | 0 |
e8da748 |
2026-08-30 00:19 UTC | — | — | — |
17848c2 |
2026-08-30 00:29 UTC | 0 | 0 | 0 |
5068eb8 |
2026-08-30 01:13 UTC | 0 | 0 | 0 |
df064f9 < |
2026-08-30 01:39 UTC | 0 | 0 | 0 |
Last scanned: df064f9 · 2026-08-30 01:39 UTC
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Manual dispatch verification (Codex 0.149.1)
Upgrade caveat this turned upCodex trusts hooks per hook, keyed Test coverage, stated honestly
A trust-aware dispatch e2e is feasible with the recipe above; it is new scope and costs a real model call per run, so it is not in this PR. |
Co-Authored-By: Claude Code <noreply@anthropic.com>
Trust the installed plugin's hooks through hooks/list plus a hooks.state config write, then assert a real codex exec run leaves the workspace state directory behind without a session marker. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Follow-up to the note above: the dispatch gap is now closed in the suite, not just manually.
CI on So the earlier "real dispatch is not covered by e2e" line is now stale: it is covered. No model tokens are spent — the suite's mock provider serves the turn. |
Summary
Upstream Codex moved on since v1.3.0; three behaviors here were still written against the old runtime.
SessionEndhook. Codex 0.146+ dispatchesSessionEndfor root sessions, so the teardown removed in v1.3.0 as non-dispatched now runs again: it reaps background jobs whose process died and clears this session's current-session marker instead of leaving it to age out after seven days. Teardown stays inside Codex's few-second budget (timeout: 3) — it never kills or waits on live processes, so detached jobs keep running and theUserPromptSubmitsweeper still covers them.[features].plugin_hooks. Upstream retired that flag (Stage::Removed), and native plugin hooks now ride on[features].hooksalone. Setup requires onlyhooks = trueand strips a leftoverplugin_hooksline from~/.codex/config.toml, the same way it already upgrades the legacycodex_hooksalias.request_user_input. Omitting[tools] experimental_request_user_inputleaves the tool enabled; only an explicitfalsehides it in an interactive thread. The conditional ask is unchanged — it still depends on the thread actually having a question tool.Upgrade notes
~/.codex/config.tomlgets its staleplugin_hooks = trueline stripped on the next$cc:setuprun.hooks/hooks.jsonchange for the newSessionEndregistration to take effect.Tests
tests/hooks.test.mjs:SessionEndreaps a dead-PID job tofailed, leaves a live jobrunning, and drops the session marker; aSessionEndfrom a different session leaves the active marker alone. Hook-name allowlist widened to the current 12HOOK_EVENT_NAMES.tests/codex-config.test.mjs:ensureNativePluginHooksEnabledrequires onlyhooksand stripsplugin_hooks;nativePluginHooksStatusreports fromhooksalone.plugin_hooks = trueassertions across install/installer/e2e/skills-contract tests inverted todoesNotMatch.npm run checkpasses (lint, typecheck, unit, integration, e2e).Note: the
SessionEndentry copiesstatusMessagefromSessionStart; if upstream ignores it for that event it is simply inert.🤖 Generated with Claude Code