Repository navigation
feat(hooks): remind users to trust Codex hooks after inject - #356
Merged
Merged
Conversation
The public Codex (the OpenAI / ChatGPT Codex app, tool id `codex`) gates non-managed hooks behind an explicit user trust step: even after teamai writes ~/.codex/hooks.json (or the project copy), Codex may skip a newly added or changed hook until the user reviews/trusts it in /hooks or Settings → Hooks. teamai never edits Codex's [hooks.state] to auto-trust — this is a UX reminder only. Scoped to the public `codex` only. The internal variants (codex-internal / tcodex) share the hooks.json format but have no trust gate, so no reminder is shown for them. - hooks.ts: export isCodexTrustGatedTool / codexTrustReminder / hasInstalledCodexTrustGatedTool - hooks-cmd.ts: after `hooks inject`, warn when the public Codex received hooks; suppressed under --silent - doctor.ts: note the same when public-Codex hooks are installed (read-only; never inspects or writes hooks.state) - tests + bilingual usage-guide docs Co-Authored-By: Claude Fable 5 <[email protected]>
jeff-r2026
force-pushed
the
feat/codex-hooks-trust-notice
branch
from
August 28, 2026 03:23
dc17191 to
56b4c0c
Compare
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
) The public Codex (the OpenAI / ChatGPT Codex app, tool id `codex`) gates non-managed hooks behind an explicit user trust step: even after teamai writes ~/.codex/hooks.json (or the project copy), Codex may skip a newly added or changed hook until the user reviews/trusts it in /hooks or Settings → Hooks. teamai never edits Codex's [hooks.state] to auto-trust — this is a UX reminder only. Scoped to the public `codex` only. The internal variants (codex-internal / tcodex) share the hooks.json format but have no trust gate, so no reminder is shown for them. - hooks.ts: export isCodexTrustGatedTool / codexTrustReminder / hasInstalledCodexTrustGatedTool - hooks-cmd.ts: after `hooks inject`, warn when the public Codex received hooks; suppressed under --silent - doctor.ts: note the same when public-Codex hooks are installed (read-only; never inspects or writes hooks.state) - tests + bilingual usage-guide docs Co-authored-by: Claude Fable 5 <[email protected]>
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.
What & Why
The public Codex (the OpenAI / ChatGPT Codex app, tool id
codex) gatesnon-managed hooks behind an explicit user trust step. Even after teamai
writes
<repo>/.codex/hooks.jsonor~/.codex/hooks.json, Codex may skip anewly added or changed hook until the user reviews/trusts it in
/hooksorSettings → Hooks. This PR adds a UX reminder so users know they may need to
trust the hooks — without ever auto-trusting.
teamai does NOT auto-trust Codex hooks. It never reads or writes Codex's
~/.codex/config.toml[hooks.state]. The reminder is purely informational,and stays conservative ("may require you to review/trust") since teamai has no
model of Codex's trust-gate state.
Scope: only the public
codex. The internal variants (codex-internal/tcodex) share the hooks.json format but have no trust gate, so no reminderis shown for them.
Changes
src/hooks.ts— exportisCodexTrustGatedTool()(only the publiccodex),codexTrustReminder()(shared wording), andhasInstalledCodexTrustGatedTool()(is the public Codex installed under abase dir, using the same root-dir gate as reconcile).
src/hooks-cmd.ts— afterteamai hooks inject,log.warnthe trustreminder when the public Codex received hooks. Suppressed under
--silent.src/doctor.ts— when public-Codex hooks are installed, print the samenote (read-only; never inspects/writes
hooks.state). Kept small —statusoutput left unchanged as it has no hook-status section.
--silentsuppressed) anddoctor (note shown / not-shown). Golden byte-compat tests unchanged and
passing — no hook command content changed.
Where the reminder appears
teamai hooks inject⚠trust reminder when the public Codex is installed; suppressed with--silentteamai doctorℹnote when public-Codex hooks are installedTest Plan
All executed against the built CLI (
npm run build+ realnode dist/index.js):npm run buildpassesnpx tsc --noEmitpassesnpx vitest run(full suite, 2308 tests) passes; golden tests includedcodexinstalled → inject prints the trust reminder;hooks.jsonwritten;--silentprints nothing;doctorshows the note; no~/.codex/config.tomlwritten (no auto-trust)codex-internalinstalled → no reminder (scope correctly narrowed)Not auto-trusting
Confirmed: teamai never writes
[hooks.state]or~/.codex/config.toml. TheE2E run verified the file is absent after inject. Trusting is left to the user.
🤖 Generated with Claude Code