docs(codex): clarify hook layering

Clarify Codex hook layering in the harness docs.
This commit is contained in:
Vincent Koc
2026-04-23 20:09:46 -07:00
committed by GitHub
parent 60956ba6ac
commit 72a8e4e5db
2 changed files with 46 additions and 7 deletions

View File

@@ -98,7 +98,7 @@ These run inside the agent loop or gateway pipeline:
- **`before_compaction` / `after_compaction`**: observe or annotate compaction cycles.
- **`before_tool_call` / `after_tool_call`**: intercept tool params/results.
- **`before_install`**: inspect built-in scan findings and optionally block skill or plugin installs.
- **`tool_result_persist`**: synchronously transform tool results before they are written to the session transcript.
- **`tool_result_persist`**: synchronously transform tool results before they are written to an OpenClaw-owned session transcript.
- **`message_received` / `message_sending` / `message_sent`**: inbound + outbound message hooks.
- **`session_start` / `session_end`**: session lifecycle boundaries.
- **`gateway_start` / `gateway_stop`**: gateway lifecycle events.
@@ -114,6 +114,10 @@ Hook decision rules for outbound/tool guards:
See [Plugin hooks](/plugins/architecture-internals#provider-runtime-hooks) for the hook API and registration details.
Harnesses may adapt these hooks differently. The Codex app-server harness keeps
OpenClaw plugin hooks as the compatibility contract for documented mirrored
surfaces, while Codex native hooks remain a separate lower-level Codex mechanism.
## Streaming + partial replies
- Assistant deltas are streamed from pi-agent-core and emitted as `assistant` events.