@@ -530,11 +530,17 @@ thread unless Codex exposes that operation through app-server or native hook
530530callbacks.
531531
532532When newer Codex app-server builds expose native compaction and model lifecycle
533- hook events, OpenClaw should version-gate that protocol support and map the
534- events into the existing OpenClaw hook contract where the semantics are honest.
535- Until then, OpenClaw's ` before_compaction ` , ` after_compaction ` , ` llm_input ` , and
536- ` llm_output ` events are adapter-level observations, not byte-for-byte captures
537- of Codex's internal request or compaction payloads.
533+ hook events, OpenClaw version-gates that protocol support and maps events into
534+ the existing OpenClaw hook contract where the semantics are honest. The
535+ OpenClaw ` before_compaction ` , ` after_compaction ` , ` llm_input ` , and ` llm_output `
536+ events remain adapter-level observations, not byte-for-byte captures of Codex's
537+ internal request or compaction payloads.
538+
539+ Codex native ` PreCompact ` and ` PostCompact ` hooks are lower-level Codex command
540+ hooks. They run inside Codex around native thread compaction, using Codex hook
541+ configuration. OpenClaw's plugin hooks do not require a user or project
542+ ` hooks.json ` , and OpenClaw does not double-fire ` before_compaction ` or
543+ ` after_compaction ` just because native Codex compaction hooks are available.
538544
539545## Tools, media, and compaction
540546
@@ -558,6 +564,12 @@ records native compaction start and completion signals. It does not yet expose a
558564human-readable compaction summary or an auditable list of which entries Codex
559565kept after compaction.
560566
567+ On Codex app-server builds with native compaction hook support, Codex can also
568+ run its own ` PreCompact ` and ` PostCompact ` command hooks around that native
569+ operation. Those hooks are useful for Codex-owned audit and policy. OpenClaw
570+ still treats the app-server compaction item stream as the source for OpenClaw
571+ plugin ` before_compaction ` and ` after_compaction ` events.
572+
561573Because Codex owns the canonical native thread, ` tool_result_persist ` does not
562574currently rewrite Codex-native tool result records. It only applies when
563575OpenClaw is writing an OpenClaw-owned session transcript tool result.
0 commit comments