You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codex install: auto-enable codex_hooks in config.toml
Removes the manual prerequisite. applyCodex now ensures
`codex_hooks = true` is present at the top level of
`~/.codex/config.toml` before writing hooks.json:
- file missing → create with the flag
- flag missing → append the line (with backup of original)
- flag = false → flip to true (with backup of original)
- flag = true → no-op
Backups follow the same .agentlock-backup-<ts> naming as hooks.json,
and the same checkSafeCodexTarget guard protects writes into a real
~/.codex (still gated by AGENTLOCK_ALLOW_APPLY_REAL_HOME=1). The
codex_hooks_disabled error path is gone on both daemon and CLI.
Tests cover all three write cases plus the no-op.
Copy file name to clipboardExpand all lines: control-plane/internal/api/install_codex.go
+127-8Lines changed: 127 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,11 @@
4
4
// daemon. See docs/reference/hook-daemon-path.md.
5
5
//
6
6
// Codex's lifecycle hooks are gated by `codex_hooks = true` in
7
-
// ~/.codex/config.toml. Apply refuses if the flag is unset; we never
8
-
// write into the user's TOML.
7
+
// ~/.codex/config.toml. Apply auto-enables the flag (creating the file
8
+
// if needed, backing it up if it existed) so users don't have to hand-
9
+
// edit their TOML before installing. The same checkSafeCodexTarget
10
+
// guard that protects hooks.json also protects config.toml — writes
11
+
// into a real ~/.codex still require AGENTLOCK_ALLOW_APPLY_REAL_HOME=1.
9
12
10
13
package api
11
14
@@ -25,8 +28,7 @@ import (
25
28
constcodexMCPGapWarning="Codex CLI: PreToolUse only fires for shell tool calls today. MCP tool calls are NOT gated by OpenAgentLock until upstream expands hook coverage."
26
29
27
30
var (
28
-
errCodexFlagDisabled=errors.New("codex_hooks = true is missing from config.toml; enable it before installing")
Copy file name to clipboardExpand all lines: docs/guide/getting-started.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ Then pick a signer tier and run `install`. Two recommended paths:
130
130
agentlock install --tier software
131
131
```
132
132
133
-
Pick the harnesses to harden, review the diff, confirm. The installer writes harness-specific configuration (e.g. `~/.claude/settings.json` hook entries, `~/.codex/config.toml``codex_hooks`) and registers a clean rollback path you can invoke later with `agentlock uninstall`.
133
+
Pick the harnesses to harden, review the diff, confirm. The installer writes harness-specific configuration (e.g. `~/.claude/settings.json` hook entries, `~/.codex/hooks.json`, plus `codex_hooks = true` in `~/.codex/config.toml` — auto-set on first install, with a backup of the original) and registers a clean rollback path you can invoke later with `agentlock uninstall`.
134
134
135
135
Open the dashboard at <http://127.0.0.1:7879/> to watch live activity.
The installer refuses to wire Codex without `codex_hooks = true` in your config; the flag is opt-in upstream.
32
+
`agentlock install` auto-enables the flag for you: it creates `~/.codex/config.toml` if missing, flips `codex_hooks = false` to `true`, or appends the line to an existing TOML — backing the original up first. The flag stays user-removable; we never enable it without an install run.
33
33
34
34
Codex command hooks are bash-only today; MCP coverage at the hook layer is a tracked upstream gap, not something we can paper over.
0 commit comments