

























@@ -34,6 +34,7 @@ These are in-process OpenClaw hooks, not Codex `hooks.json` command hooks:
3434- `llm_input`, `llm_output`
3535- `before_tool_call`, `after_tool_call`
3636- `before_message_write` for mirrored transcript records
37+- `before_agent_finalize` through Codex `Stop` relay
3738- `agent_end`
38393940Plugins can also register runtime-neutral tool-result middleware to rewrite
@@ -583,10 +584,10 @@ The Codex harness has three hook layers:
583584584585OpenClaw does not use project or global Codex `hooks.json` files to route
585586OpenClaw plugin behavior. For the supported native tool and permission bridge,
586-OpenClaw injects per-thread Codex config for `PreToolUse`, `PostToolUse`, and
587-`PermissionRequest`. Other Codex hooks such as `SessionStart`,
588-`UserPromptSubmit`, and `Stop` remain Codex-level controls; they are not exposed
589-as OpenClaw plugin hooks in the v1 contract.
587+OpenClaw injects per-thread Codex config for `PreToolUse`, `PostToolUse`,
588+`PermissionRequest`, and `Stop`. Other Codex hooks such as `SessionStart` and
589+`UserPromptSubmit` remain Codex-level controls; they are not exposed as
590+OpenClaw plugin hooks in the v1 contract.
590591591592For OpenClaw dynamic tools, OpenClaw executes the tool after Codex asks for the
592593call, so OpenClaw fires the plugin and middleware behavior it owns in the
@@ -622,6 +623,7 @@ Supported in Codex runtime v1:
622623| Context engine lifecycle | Supported | Assemble, ingest or after-turn maintenance, and context-engine compaction coordination run for Codex turns. |
623624| Dynamic tool hooks | Supported | `before_tool_call`, `after_tool_call`, and tool-result middleware run around OpenClaw-owned dynamic tools. |
624625| Lifecycle hooks | Supported as adapter observations | `llm_input`, `llm_output`, `agent_end`, `before_compaction`, and `after_compaction` fire with honest Codex-mode payloads. |
626+| Final-answer revision gate | Supported through the native hook relay | Codex `Stop` is relayed to `before_agent_finalize`; `revise` asks Codex for one more model pass before finalization. |
625627| Native shell, patch, and MCP block or observe | Supported through the native hook relay | Codex `PreToolUse` and `PostToolUse` are relayed for committed native tool surfaces, including MCP payloads on Codex app-server `0.125.0` or newer. Blocking is supported; argument rewriting is not. |
626628| Native permission policy | Supported through the native hook relay | Codex `PermissionRequest` can be routed through OpenClaw policy where the runtime exposes it. If OpenClaw returns no decision, Codex continues through its normal guardian or user approval path. |
627629| App-server trajectory capture | Supported | OpenClaw records the request it sent to app-server and the app-server notifications it receives. |
@@ -635,7 +637,6 @@ Not supported in Codex runtime v1:
635637| `tool_result_persist` for Codex-native tool records | That hook transforms OpenClaw-owned transcript writes, not Codex-native tool records. | Could mirror transformed records, but canonical rewrite needs Codex support. |
636638| Rich native compaction metadata | OpenClaw observes compaction start and completion, but does not receive a stable kept/dropped list, token delta, or summary payload. | Needs richer Codex compaction events. |
637639| Compaction intervention | Current OpenClaw compaction hooks are notification-level in Codex mode. | Add Codex pre/post compaction hooks if plugins need to veto or rewrite native compaction. |
638-| Stop or final-answer gating | Codex has native stop hooks, but OpenClaw does not expose final-answer gating as a v1 plugin contract. | Future opt-in primitive with loop and timeout safeguards. |
639640| Byte-for-byte model API request capture | OpenClaw can capture app-server requests and notifications, but Codex core builds the final OpenAI API request internally. | Needs a Codex model-request tracing event or debug API. |
640641641642## Tools, media, and compaction
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。