Skip to content

Commit 5171c5b

Browse files
committed
fix: drop removed codex plugin hooks flag
1 parent 1249282 commit 5171c5b

9 files changed

Lines changed: 25 additions & 23 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ The format follows Keep a Changelog, and marketplace/plugin versions follow Sema
1212
checks use current profile files (`$CODEX_HOME/rldyour-yolo.config.toml` and
1313
`$CODEX_HOME/rldyour-safe.config.toml`) instead of removed legacy
1414
`profile = "..."` selectors and `[profiles.*]` tables.
15+
- System install and doctor now remove the obsolete `features.plugin_hooks`
16+
flag because Codex 0.134 reports plugin hooks as default-enabled; hook
17+
correctness is verified through trusted `hooks/list` output.
1518
- Context7 MCP now pins `@upstash/context7-mcp@3.0.0`, matching the current
1619
npm stable package in `.mcp.json` and `config/mcp-runtime-versions.env`.
1720

config/rldyour-contract.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
}
8484
},
8585
"hooks": {
86-
"plugin_hooks_required": true,
86+
"plugin_hooks_required": false,
87+
"plugin_hooks_default_enabled": true,
8788
"handler_type": "command",
8889
"lifecycles": {
8990
"prompt.submit.sync-required": {

docs/contract-matrix.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ the human-readable matrix for the same facts.
3333

3434
## Hook Lifecycle Mapping
3535

36-
Codex bundled plugin hooks require `[features].plugin_hooks = true`. Hook
37-
handlers are command handlers and resolve plugin-owned scripts through
38-
`PLUGIN_ROOT`.
36+
Codex 0.134 reports `plugin_hooks` as a removed feature flag; bundled plugin
37+
hooks are default-enabled through the plugin runtime and verified with trusted
38+
`hooks/list` output. Hook handlers are command handlers and resolve
39+
plugin-owned scripts through `PLUGIN_ROOT`.
3940

4041
| Lifecycle contract | Plugin | Codex event | Script |
4142
| --- | --- | --- | --- |

references/codex-baseline.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"runtime_contract": {
1212
"hooks": "command-only",
1313
"hooks_enabled_by_default": true,
14-
"plugin_hooks_feature_flag": "features.plugin_hooks",
15-
"plugin_hooks_required": true,
14+
"plugin_hooks_feature_flag": null,
15+
"plugin_hooks_required": false,
16+
"plugin_hooks_default_enabled": true,
1617
"matching_command_hooks_may_run_concurrently": true
1718
},
1819
"owner_runtime_policy": {

scripts/doctor_system_codex.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ checks.append(("repo trusted", project.get("trust_level") == "trusted"))
197197
198198
features = config_data.get("features") or {}
199199
checks.append(("hooks feature enabled", features.get("hooks") is True))
200-
checks.append(("plugin hooks feature enabled", features.get("plugin_hooks") is True))
201200
checks.append(("multi-agent feature enabled", features.get("multi_agent") is True))
202201
deprecated_feature_keys = {
203202
"codex_hooks",
203+
"plugin_hooks",
204204
"use_legacy_landlock",
205205
"web_search",
206206
"web_search_cached",

scripts/install_system_codex.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Managed state:
2121
- rldyour-codex marketplace registration
2222
- enabled rldyour plugins plus curated GitHub and Gmail plugins
2323
- hooks feature flag
24-
- plugin hooks feature flag
24+
- plugin hook trust state
2525
- multi-agent feature flag
2626
- Codex config deprecated-key migration for managed global setup
2727
- owner-standard YOLO/full-auto permission defaults by default
@@ -422,7 +422,6 @@ in_memories = False
422422
features_table_seen = False
423423
feature_dotted_lines: list[str] = []
424424
hooks_written = False
425-
plugin_hooks_written = False
426425
multi_agent_written = False
427426
memories_external_context_written = "disable_on_external_context" in existing_memories
428427
current_header: str | None = None
@@ -443,6 +442,7 @@ deprecated_root_keys = {
443442
"experimental_use_unified_exec_tool",
444443
}
445444
deprecated_feature_keys = {
445+
"plugin_hooks",
446446
"use_legacy_landlock",
447447
"web_search",
448448
"web_search_cached",
@@ -534,13 +534,10 @@ out.append("")
534534
535535
536536
def append_managed_features() -> None:
537-
global hooks_written, plugin_hooks_written, multi_agent_written
537+
global hooks_written, multi_agent_written
538538
if not hooks_written:
539539
out.append("hooks = true")
540540
hooks_written = True
541-
if not plugin_hooks_written:
542-
out.append("plugin_hooks = true")
543-
plugin_hooks_written = True
544541
if not multi_agent_written:
545542
out.append("multi_agent = true")
546543
multi_agent_written = True
@@ -637,9 +634,6 @@ for raw_line in existing.splitlines():
637634
hooks_written = True
638635
continue
639636
if feature_key == "plugin_hooks":
640-
if not plugin_hooks_written:
641-
out.append("plugin_hooks = true")
642-
plugin_hooks_written = True
643637
continue
644638
if feature_key == "multi_agent":
645639
if not multi_agent_written:

scripts/smoke_codex_hooks_migration.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,9 @@ features = data.get("features") or {}
181181
182182
if features.get("hooks") is not True:
183183
raise SystemExit(f"{case_name}: expected [features].hooks = true, got {features!r}")
184-
if features.get("plugin_hooks") is not True:
185-
raise SystemExit(f"{case_name}: expected [features].plugin_hooks = true, got {features!r}")
186184
deprecated_features = {
187185
"codex_hooks",
186+
"plugin_hooks",
188187
"use_legacy_landlock",
189188
"web_search",
190189
"web_search_cached",

scripts/validate_contract.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,14 @@ def main() -> int:
161161
if not isinstance(hooks, dict):
162162
errors.append("hooks: expected object")
163163
else:
164-
if hooks.get("plugin_hooks_required") is not True:
165-
errors.append("hooks.plugin_hooks_required must be true")
164+
if hooks.get("plugin_hooks_required") is not False:
165+
errors.append("hooks.plugin_hooks_required must be false for current Codex")
166+
if hooks.get("plugin_hooks_default_enabled") is not True:
167+
errors.append("hooks.plugin_hooks_default_enabled must be true for current Codex")
166168
for script in ("scripts/install_system_codex.sh", "scripts/doctor_system_codex.sh"):
167-
if "plugin_hooks" not in (ROOT / script).read_text(encoding="utf-8"):
168-
errors.append(f"{script}: must enforce/check features.plugin_hooks")
169+
script_text = (ROOT / script).read_text(encoding="utf-8")
170+
if 'plugin_hooks = true' in script_text or 'features.get("plugin_hooks") is True' in script_text:
171+
errors.append(f"{script}: must not write or require removed features.plugin_hooks")
169172
expected_handler_type = hooks.get("handler_type")
170173
for plugin in ("rldyour-flow", "rldyour-serena-mcp"):
171174
for event, handler in iter_hook_handlers(hook_manifest(plugin)):

system/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ For edits, prefer Serena symbol tools when supported. Use `apply_patch` for manu
143143

144144
The canonical source for this global setup is the `rldyour-codex` repository.
145145

146-
System Codex installs the owner-standard full-auto profile by default with the official Codex config schema hint, `approval_policy = "never"`, `sandbox_mode = "danger-full-access"`, `default_permissions = ":danger-full-access"`, `model = "gpt-5.5"`, `model_reasoning_effort = "xhigh"`, `suppress_unstable_features_warning = true`, managed subagents on `gpt-5.5`/`medium` with temporary specialist-MCP isolation, and `[features].hooks = true`, `[features].plugin_hooks = true`, plus `[features].multi_agent = true`. Current Codex profile selection uses `$CODEX_HOME/<name>.config.toml`, so the installer writes `rldyour-yolo.config.toml` and `rldyour-safe.config.toml` and must not write legacy `profile = "..."` selectors or `[profiles.*]` tables. The owner-standard mode is also referred to as YOLO mode, full-auto mode, and dangerously-skip-permissions mode. `scripts/install_system_codex.sh --apply --safe-mode` is the explicit conservative override and selects `approval_policy = "on-request"` and `sandbox_mode = "workspace-write"` only when the owner intentionally asks for that posture. Current Codex documentation treats `sandbox_mode` as the active older sandbox model when present, so do not migrate this owner profile to beta permission profiles without an explicit policy decision. Current Codex CLI keeps plugin-bundled hooks behind `plugin_hooks`, so the flag is intentionally explicit. Deprecated config aliases such as `codex_hooks`, legacy `features.web_search*`, `experimental_instructions_file`, `background_terminal_timeout`, `experimental_use_unified_exec_tool`, `memories.no_memories_if_mcp_or_web_search`, `use_legacy_landlock`, legacy `profile`, and legacy `[profiles.*]` must not be present. Continue to avoid destructive actions unless the owner explicitly requests them.
146+
System Codex installs the owner-standard full-auto profile by default with the official Codex config schema hint, `approval_policy = "never"`, `sandbox_mode = "danger-full-access"`, `default_permissions = ":danger-full-access"`, `model = "gpt-5.5"`, `model_reasoning_effort = "xhigh"`, `suppress_unstable_features_warning = true`, managed subagents on `gpt-5.5`/`medium` with temporary specialist-MCP isolation, and `[features].hooks = true` plus `[features].multi_agent = true`. Current Codex profile selection uses `$CODEX_HOME/<name>.config.toml`, so the installer writes `rldyour-yolo.config.toml` and `rldyour-safe.config.toml` and must not write legacy `profile = "..."` selectors or `[profiles.*]` tables. The owner-standard mode is also referred to as YOLO mode, full-auto mode, and dangerously-skip-permissions mode. `scripts/install_system_codex.sh --apply --safe-mode` is the explicit conservative override and selects `approval_policy = "on-request"` and `sandbox_mode = "workspace-write"` only when the owner intentionally asks for that posture. Current Codex documentation treats `sandbox_mode` as the active older sandbox model when present, so do not migrate this owner profile to beta permission profiles without an explicit policy decision. Current Codex 0.134 reports `plugin_hooks` as a removed feature flag; plugin hook availability is default-enabled and verified through trusted `hooks/list` output instead of a config flag. Deprecated config aliases such as `codex_hooks`, `plugin_hooks`, legacy `features.web_search*`, `experimental_instructions_file`, `background_terminal_timeout`, `experimental_use_unified_exec_tool`, `memories.no_memories_if_mcp_or_web_search`, `use_legacy_landlock`, legacy `profile`, and legacy `[profiles.*]` must not be present. Continue to avoid destructive actions unless the owner explicitly requests them.
147147

148148
System install and doctor checks derive rldyour plugin enablement from `.agents/plugins/marketplace.json`, the Codex adapter surface from `config/rldyour-contract.json`, and MCP server registration from `plugins/rldyour-mcps/.mcp.json`; do not add parallel hardcoded plugin or MCP lists. The installer syncs plugin cache into versioned `${CODEX_HOME:-$HOME/.codex}/plugins/cache/rldyour-codex/<plugin>/<version>` directories first, installs managed Codex execpolicy rules from `system/rules/*.rules` into `${CODEX_HOME:-$HOME/.codex}/rules/*.rules`, then refreshes installed rldyour plugin hook trust hashes through the app-server RPC method `hooks/list` over `codex app-server --listen stdio://`; doctor and runtime smoke verify that all installed rldyour plugin hooks are live, enabled, trusted, and that managed rules are in sync.
149149

0 commit comments

Comments
 (0)