Repository navigation
Description
Summary
infer can now run user-configured shell commands at agent-loop hook points (source: inference-gateway/cli#270), the executable sibling of the system reminders added in inference-gateway/cli#669. Commands live in a dedicated .infer/hooks.yaml, are feature-flagged off by default, and are gated through the existing per-mode bash allow-list (no new bypass of the secure-by-default model). The docs site needs a page covering the feature.
User-facing behavior to document:
-
New config file
.infer/hooks.yaml(project) /~/.infer/hooks.yaml(userspace), generated byinfer init:enabled: false hooks: - name: gofmt hook: post_session command: "gofmt -w ." timeout: 30 # seconds; 0 -> default 30
-
hookis one of the pre-defined hook points:pre_session,pre_stream,post_stream,pre_tool,post_tool,pre_queue_drain,post_queue_drain,post_session.post_session("agent finished generating") is the primary one, for deterministic post-processing (format, lint, test, notify). -
Authorization: a command runs only if it passes the per-mode bash allow-list (
tools.bash.mode.*.allow); an off-list command is skipped and reported, never run. To allow a command unattended (CI), add it to the allow-list or useINFER_TOOLS_BASH_ALLOW_APPEND, e.g.INFER_TOOLS_BASH_ALLOW_APPEND="gofmt.*"sogofmt -w .runs atpost_session. -
Master switch env override:
INFER_HOOKS_ENABLED=true. -
v1 is fire-and-observe: each run emits a
hook_commandstream event (name, exit code, duration, truncated output); output is not fed back into the conversation.
Affected pages / proposed locations:
- A new "Hooks" page under the CLI configuration docs, alongside the reminders /
reminders.yamlpage. - The configuration-files reference/table: add the
hooks.yamlrow (mirroringreminders.yaml).
Acceptance Criteria
- A docs page documents
hooks.yaml(schema:enabled,hooks[].name/hook/command/timeout) with theinfer initdefault example. - The allow-list authorization model is documented (off-list -> skipped; allow-list or
INFER_TOOLS_BASH_ALLOW_APPENDto enable; secure-by-default headless). - The hook-point catalog and the
post_sessionCI post-processing example are documented. - The configuration-files reference lists
hooks.yaml.
Source: inference-gateway/cli#270 (implementation); builds on inference-gateway/cli#669.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Jun 28, 2026
@infer /model ollama_cloud/glm-5.2 Can you document it?
inference-gateway-maintainer commentedon Jun 28, 2026
View Job
Todos
Pull Request
#293
✅ Infer Result: Success
PR #293 is open and linked to issue #287. No further work needed.
Model:
ollama_cloud/glm-5.2· Exit Code:0· Duration: 7m 38sTokens: 2,992,749 in · 15,945 out · 3,008,694 total (55 requests)
Tool calls: 66 total · 91% success rate
[�[33mwarn�[39m] cli-hooks.md
[�[33mwarn�[39m] cli.md
[�[33mwarn�[39m] Code style issues found in 2 files. Run Prettier with --write to fix.
Triggered by edenreich · Infer Action
inference-gateway-releaser commentedon Jun 29, 2026
🎉 This issue has been resolved in version 0.6.114 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀