


























@@ -944,9 +944,14 @@ The Codex harness has three hook layers:
944944OpenClaw does not use project or global Codex `hooks.json` files to route
945945OpenClaw plugin behavior. For the supported native tool and permission bridge,
946946OpenClaw injects per-thread Codex config for `PreToolUse`, `PostToolUse`,
947-`PermissionRequest`, and `Stop`. Other Codex hooks such as `SessionStart` and
948-`UserPromptSubmit` remain Codex-level controls; they are not exposed as
949-OpenClaw plugin hooks in the v1 contract.
947+`PermissionRequest`, and `Stop`. When Codex app-server approvals are enabled
948+(`approvalPolicy` is not `"never"`), the default injected native hook config
949+omits `PermissionRequest` so Codex's app-server reviewer and OpenClaw's approval
950+bridge handle real escalations after review. Operators can still explicitly add
951+`permission_request` to `nativeHookRelay.events` when they need the compatibility
952+relay. Other Codex hooks such as `SessionStart` and `UserPromptSubmit` remain
953+Codex-level controls; they are not exposed as OpenClaw plugin hooks in the v1
954+contract.
950955951956For OpenClaw dynamic tools, OpenClaw executes the tool after Codex asks for the
952957call, so OpenClaw fires the plugin and middleware behavior it owns in the
@@ -973,19 +978,19 @@ around that boundary.
973978974979Supported in Codex runtime v1:
975980976-| Surface | Support | Why |
977-| --------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
978-| OpenAI model loop through Codex | Supported | Codex app-server owns the OpenAI turn, native thread resume, and native tool continuation. |
979-| OpenClaw channel routing and delivery | Supported | Telegram, Discord, Slack, WhatsApp, iMessage, and other channels stay outside the model runtime. |
980-| OpenClaw dynamic tools | Supported | Codex asks OpenClaw to execute these tools, so OpenClaw stays in the execution path. |
981-| Prompt and context plugins | Supported | OpenClaw builds prompt overlays and projects context into the Codex turn before starting or resuming the thread. |
982-| Context engine lifecycle | Supported | Assemble, ingest or after-turn maintenance, and context-engine compaction coordination run for Codex turns. |
983-| Dynamic tool hooks | Supported | `before_tool_call`, `after_tool_call`, and tool-result middleware run around OpenClaw-owned dynamic tools. |
984-| Lifecycle hooks | Supported as adapter observations | `llm_input`, `llm_output`, `agent_end`, `before_compaction`, and `after_compaction` fire with honest Codex-mode payloads. |
985-| 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. |
986-| 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. |
987-| 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. |
988-| App-server trajectory capture | Supported | OpenClaw records the request it sent to app-server and the app-server notifications it receives. |
981+| Surface | Support | Why |
982+| --------------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
983+| OpenAI model loop through Codex | Supported | Codex app-server owns the OpenAI turn, native thread resume, and native tool continuation. |
984+| OpenClaw channel routing and delivery | Supported | Telegram, Discord, Slack, WhatsApp, iMessage, and other channels stay outside the model runtime. |
985+| OpenClaw dynamic tools | Supported | Codex asks OpenClaw to execute these tools, so OpenClaw stays in the execution path. |
986+| Prompt and context plugins | Supported | OpenClaw builds prompt overlays and projects context into the Codex turn before starting or resuming the thread. |
987+| Context engine lifecycle | Supported | Assemble, ingest or after-turn maintenance, and context-engine compaction coordination run for Codex turns. |
988+| Dynamic tool hooks | Supported | `before_tool_call`, `after_tool_call`, and tool-result middleware run around OpenClaw-owned dynamic tools. |
989+| Lifecycle hooks | Supported as adapter observations | `llm_input`, `llm_output`, `agent_end`, `before_compaction`, and `after_compaction` fire with honest Codex-mode payloads. |
990+| 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. |
991+| 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. |
992+| Native permission policy | Supported through Codex app-server approvals and the compatibility native hook relay | Codex app-server approval requests route through OpenClaw after Codex review. The `PermissionRequest` native hook relay is opt-in for native approval modes because Codex emits it before guardian review. |
993+| App-server trajectory capture | Supported | OpenClaw records the request it sent to app-server and the app-server notifications it receives. |
989994990995Not supported in Codex runtime v1:
991996@@ -1016,6 +1021,14 @@ it.
10161021For `PermissionRequest`, OpenClaw only returns explicit allow or deny decisions
10171022when policy decides. A no-decision result is not an allow. Codex treats it as no
10181023hook decision and falls through to its own guardian or user approval path.
1024+Codex app-server approval modes omit this native hook by default; this paragraph
1025+applies when `permission_request` is explicitly included in
1026+`nativeHookRelay.events` or a compatibility runtime installs it.
1027+When an operator chooses `allow-always` for a Codex native permission request,
1028+OpenClaw remembers that exact provider/session/tool input/cwd fingerprint for a
1029+bounded session window. The remembered decision is intentionally exact-match
1030+only: a changed command, arguments, tool payload, or cwd creates a fresh
1031+approval.
1019103210201033Codex MCP tool approval elicitations are routed through OpenClaw's plugin
10211034approval flow when Codex marks `_meta.codex_approval_kind` as
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。