Skip to content

docs(codex): document native model lifecycle hooks - #70907

Closed
vincentkoc wants to merge 1 commit into
mainfrom
docs/codex-native-model-lifecycle-hooks
Closed

vincentkoc wants to merge 1 commit into
mainfrom
docs/codex-native-model-lifecycle-hooks

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

  • document Codex native PreModelRequest / PostModelResponse hooks as Codex-owned command hooks
  • clarify that OpenClaw plugin llm_input / llm_output remain adapter-level compatibility events
  • call out that OpenClaw does not double-fire model lifecycle plugin hooks when Codex native hooks are available

Dependency

Validation

  • pnpm format:check -- docs/plugins/codex-harness.md docs/concepts/agent-loop.md
  • pnpm docs:list
  • pnpm check:changed

@vincentkoc vincentkoc self-assigned this Apr 24, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Apr 24, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 3, 2026, 2:55 AM ET / 06:55 UTC.

Summary
The PR adds docs wording for Codex native model lifecycle hooks and clarifies OpenClaw llm_input / llm_output as adapter-level plugin events.

PR surface: Docs +10. Total +10 across 2 files.

Reproducibility: not applicable. this is a docs-only PR rather than a runtime bug report. The high-confidence check is dependency-contract verification against current OpenClaw docs/code and sibling Codex source.

Review metrics: 1 noteworthy metric.

  • Upstream Hook Contract: 0 of 2 documented model hook names found. Docs checks cannot validate dependency-backed Codex hook names, so maintainers need source proof before publishing this contract.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🌊 off-meta tidepool
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Remove or gate unsupported native model hook names until current Codex exposes them.
  • Refresh the branch against current main and preserve the current adapter-boundary wording.

Risk before merge

  • [P1] Merging this PR as written would publish native Codex model hook names that current Codex hook enums, hook config, app-server protocol, and OpenClaw relay code do not support.
  • [P1] The branch is draft, conflicting, and protected by the maintainer label, so the remaining decision needs maintainer or author handling rather than cleanup closure.

Maintainer options:

  1. Gate On Upstream Codex Support (recommended)
    Remove or conditionalize the PreModelRequest and PostModelResponse wording until current Codex source exposes those exact hook events in config and app-server protocol.
  2. Retarget To Adapter-Only Docs
    Keep the useful OpenClaw llm_input / llm_output compatibility explanation and leave native model lifecycle hook names out of public docs for now.
  3. Leave Parked For Maintainer Direction
    Keep the protected draft open if maintainers want to wait for upstream Codex model hook support instead of rewriting the docs now.

Next step before merge

  • A maintainer or the author should refresh this protected draft and decide whether to wait for upstream Codex hook support or retarget it to adapter-only docs.

Security
Cleared: Docs-only changes do not introduce code execution, dependency, workflow, permission, secret, package, or supply-chain surface.

Review findings

  • [P2] Gate native model hook names on Codex support — docs/plugins/codex-harness.md:540-544
Review details

Best possible solution:

Keep the current adapter-boundary docs, refresh the branch, and add native model request/response hook wording only after upstream Codex exposes that contract.

Do we have a high-confidence way to reproduce the issue?

Not applicable; this is a docs-only PR rather than a runtime bug report. The high-confidence check is dependency-contract verification against current OpenClaw docs/code and sibling Codex source.

Is this the best way to solve the issue?

No, not as written. The adapter-boundary clarification is useful, but the native model hook names should be removed or explicitly gated until current Codex exposes them.

Full review comments:

  • [P2] Gate native model hook names on Codex support — docs/plugins/codex-harness.md:540-544
    This documents PreModelRequest and PostModelResponse as native Codex command hooks, but current Codex hook enums, hook config, and app-server protocol do not expose those events, and the linked upstream Codex PRs are closed unmerged. Remove or conditionalize these names, including the parallel agent-loop wording, until upstream support exists.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8ed6c78b7891.

Label changes

Label justifications:

  • P3: This is a docs-only maintainer draft with low runtime blast radius, even though the dependency-contract wording blocks merge.
  • merge-risk: 🚨 other: Merging could publish unsupported upstream Codex hook names that normal docs formatting and CI checks would not catch.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Evidence reviewed

PR surface:

Docs +10. Total +10 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 2 15 5 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 15 5 +10

What I checked:

Likely related people:

  • vincentkoc: Merged history shows this person introduced OpenClaw Codex llm_input / llm_output lifecycle hook support and has recent Codex harness helper work. (role: LLM lifecycle hook feature owner; confidence: high; commits: 34e45ecfcc79, cbf6f0001bc0; files: src/agents/harness/lifecycle-hook-helpers.ts, extensions/codex/src/app-server/run-attempt.ts, docs/plugins/codex-harness.md)
  • pashpashpash: Merged history shows this person introduced the Codex native hook relay boundary that defines which native Codex events OpenClaw can bridge. (role: native hook relay introducer; confidence: high; commits: 7a958d920c88; files: extensions/codex/src/app-server/native-hook-relay.ts, src/agents/harness/native-hook-relay.ts, src/plugin-sdk/agent-harness-runtime.ts)
  • steipete: Recent merged history on the same native relay and Codex runtime docs surfaces includes report-mode approval and fallback behavior changes. (role: recent native relay and Codex docs contributor; confidence: medium; commits: 56a5d7e8657e, fb64546d9e6f, b87510957f07; files: docs/plugins/codex-harness-runtime.md, src/agents/harness/native-hook-relay.ts, extensions/codex/src/app-server/native-hook-relay.ts)
  • 100yenadmin: The merged Pi/Codex harness seam work is linked from this PR discussion and covers adjacent lifecycle and observability boundaries. (role: adjacent harness seam contributor; confidence: medium; commits: c13836804058; files: src/agents/harness/types.ts, src/plugins/provider-runtime.ts, docs/tools/plugin.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 15, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closing this because the dependency contract never landed.

Upstream openai/codex#19182 closed unmerged. I rechecked current Codex be33f80bc65159c094ecd06bf155afa3061ce23d: codex-rs/protocol/src/protocol.rs defines the supported HookEventName variants, and codex-rs/config/src/hook_config.rs defines the configurable hook sections; neither contains PreModelRequest nor PostModelResponse. OpenClaw's current Codex relay is narrower as well and does not expose either event.

The useful adapter-boundary statement is already present on current main: OpenClaw llm_input and llm_output are compatibility observations, while Codex native hooks are a separate mechanism. Adding unsupported native hook names would make the public docs less accurate, so this old draft is no longer needed. Thanks for exploring the upstream direction, @vincentkoc.

@steipete steipete closed this Jul 6, 2026
@shakkernerd
shakkernerd deleted the docs/codex-native-model-lifecycle-hooks branch October 19, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants