Synced from monorepo
Synced from monorepo Changes: - Report invalid MCP server config instead of failing startup - Keep completed terminal output when the gateway connection is lost - Show a duration-only detail view for single-task task output - Don't let a stale registry turn counter hide local sessions - Raise the file-descriptor soft limit on Linux and log effective limits at startup - Stop aborting when HTTP client construction fails - Make session thread and runtime spawn failures recoverable - Fix main-prompt paste parity in the question freeform input - Fire SessionEnd hooks on /exit and headless quit - Embed the deployment-config signing public key - Repaint paste-chip background on inline panel inputs - Security: prevent acceptEdits from auto-approving agent writes into the always-trusted global hook root - Fix stacked "Worked for" markers so parks render as status and turns close with exactly one marker - Parse hooks from config files - Add a remote kill-switch for managed-config signature verification - Security: fix workspace file-reference resolution bypassing workspace filesystem confinement Source-Revision: d02693a856a54f1030695b36b91d276e96b30b23
This commit is contained in:
parent
6e38642082
commit
47348d13ec
138 changed files with 7283 additions and 5796 deletions
|
|
@ -1727,6 +1727,32 @@ Grok discovers hooks from `.grok/hooks/` in the project directory. Manage them w
|
|||
/hooks-add <path> # add a custom hook file or directory
|
||||
```
|
||||
|
||||
### Hooks in config files
|
||||
|
||||
Hooks can also be defined directly in the config layers, so they can be
|
||||
distributed with your other configuration instead of as separate JSON files. Add
|
||||
a `[[hooks.<Event>]]` table to `config.toml` (your own), `managed_config.toml`, or
|
||||
`requirements.toml`:
|
||||
|
||||
```toml
|
||||
[[hooks.PreToolUse]]
|
||||
matcher = "Bash|Write|Edit"
|
||||
[[hooks.PreToolUse.hooks]]
|
||||
type = "command"
|
||||
command = "/opt/guard/pretooluse.sh" # use an absolute path
|
||||
timeout = 10
|
||||
```
|
||||
|
||||
The schema matches the JSON `hooks` object used in hook files. Hooks are read from
|
||||
every layer and combined additively: a lower-priority layer can add hooks but
|
||||
never removes or replaces another layer's block. Each hook's `/hooks-list` name is
|
||||
prefixed with the layer it came from (for example `managed:` or
|
||||
`requirements/user:`).
|
||||
|
||||
Config-layer hooks are convenience distribution, not an enforcement boundary: on
|
||||
an unmanaged device a user can still edit these files. Tamper-resistant,
|
||||
admin-enforced hooks are tracked separately.
|
||||
|
||||
---
|
||||
|
||||
## Custom Models
|
||||
|
|
|
|||
Loading…
Reference in a new issue