[codex] Improve Codex plugin hook trust doctor - #258
Merged
Conversation
|
ScriptedAlchemy
force-pushed
the
codex/codex-hook-trust-doctor
branch
2 times, most recently
from
July 3, 2026 22:53
6632510 to
a94fe26
Compare
Inspect Codex `config.toml` [hooks.state] and report which managed hooks still lack a sha256 trust entry, instead of a generic `/hooks` reminder. Drops the obsolete config-managed doctor paths. Co-Authored-By: Claude <noreply@anthropic.com>
update_plugin now migrates a legacy config-only Codex install to the plugin bundle and sweeps the old config, rather than reporting ConfigOnly. Project-local Codex installs no longer ship hooks/hooks.json. Co-Authored-By: Claude <noreply@anthropic.com>
Repo-local Codex installs intentionally stop shipping hooks/hooks.json (Codex only trusts personal-plugin hooks), but two tests still asserted the old layout. assert_codex_rendered_bundle_valid now takes an expect_hooks flag (asserting absence for repo-local bundles), and the codex local-install path list drops hooks/hooks.json. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ScriptedAlchemy
force-pushed
the
codex/codex-hook-trust-doctor
branch
from
July 3, 2026 23:53
32e8892 to
32b02ef
Compare
Make hook assertions scope-explicit and address review findings: assert_codex_bundle_contains_bin silently skipped hook validation when hooks/hooks.json was absent, letting global refresh tests pass even if hooks stopped rendering; and the global-vs-repo-local scope policy was scattered as ad-hoc conditionals across bundle writing, manifest/MCP mutation, and the doctor. - Add CodexBundlePolicy (include_hooks, mcp_args, mcp_env, hook_trust_config_path, include_memory_digest) consumed by the bundle writer, renderers, and doctor; collapse doctor_check_plugin's duplicated manifest/version/MCP checks into doctor_check_plugin_dir, which now warns if a repo-local bundle unexpectedly ships hooks. - Tests take an explicit CodexScope: global bundles must ship hooks/hooks.json, repo-local bundles must not; repo-local rendered bundles keep the placeholder and source-coverage checks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ScriptedAlchemy
force-pushed
the
codex/codex-hook-trust-doctor
branch
from
July 4, 2026 00:21
34c2b70 to
866cb61
Compare
Review findings on the migration/doctor flow: - update_plugin could sweep a working legacy config-managed global install while only a repo-local bundle refreshed, leaving no personal plugin as replacement; the bootstrap now installs whenever a legacy migration runs, and the sweep prints the required `codex plugin add tracedecay@personal` next step - local-only installs (repo bundle, no personal plugin) got an all-green doctor with zero lifecycle hooks anywhere; healthcheck now warns that repo-local bundles ship no hooks - the trusted-state info line now says trust is pinned to hook content, so a post-update hooks.json rewrite prompts a /hooks re-trust instead of reading as all-clear - config.toml delete-if-empty now takes the same backup as the rewrite path; uninstall_hooks only rewrites and reports when it removed entries - hook state keys derive from the managed hook's subcommand instead of a hand-rolled CamelCase converter that would break on acronym events Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- codex_config_path centralizes the four hand-built ~/.codex/config.toml joins - codex_plugin_hook_trust_state treats a missing [hooks.state] table as empty so one pipeline produces the missing list - stamp_manifest_version_with lets Codex strip the repo-local hooks key on the already-parsed manifest instead of a second JSON round-trip - update_plugin folds the duplicated personal-bootstrap branches into one needs-personal condition Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ScriptedAlchemy
marked this pull request as ready for review
July 4, 2026 00:50
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Jul 4, 2026
Merged
ScriptedAlchemy
added a commit
that referenced
this pull request
Jul 4, 2026
Return raw JSON envelopes from the fact_store and fact_feedback memory write handlers instead of markdown-rendered output. After the markdown default output change, these write-path handlers rendered their status JSON as markdown, which interfered with the memory digest export lifecycle. A new `tool_json` helper emits the truncated JSON envelope (with project handle) directly; `handle_memory_status` continues to use the rendered path. Recovered from a stranded worktree whose stale rebase base had reverted unrelated master work (PR #258/#260 agent-surface changes); only the genuine memory.rs fix is carried forward here, rebuilt cleanly on current origin/master. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.codex/config.tomlinstead of always printing the generic/hooksreminder.codex/hooks.json/legacy config as supported installsupdate-pluginmigrate legacy Codex config-managed installs by installing the plugin bundleContext
Official Codex docs say plugin-bundled hooks are skipped until reviewed/trusted,
/hooksmanages hook trust, and project-local hooks only load when a project.codex/layer is trusted:Validation
cargo test codex_hook_trust_state --libcargo test codex_update_plugin_migrates_legacy_config_only_install_to_plugin --test agent_suitecargo test test_healthcheck_codex --test agent_suitecargo test test_codex_local_install_bundles_hooks_in_plugin --test agent_suitecargo run --quiet -- doctor --agent codex