Skip to content

fix(codex): use stable hooks feature flag#82078

Merged
pash-openai merged 1 commit into
mainfrom
fix/codex-hooks-feature-flag
May 15, 2026
Merged

fix(codex): use stable hooks feature flag#82078
pash-openai merged 1 commit into
mainfrom
fix/codex-hooks-feature-flag

Conversation

@velvet-shark

Copy link
Copy Markdown
Member

Summary

OpenClaw's Codex app-server native hook relay now emits the stable features.hooks flag instead of the deprecated features.codex_hooks flag. This keeps the generated per-thread config aligned with current Codex CLI behavior and removes the confusing Settings warning when the user's own config.toml is clean.

Verification

  • codex --version && codex features list
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.extensions.config.ts extensions/codex/src/app-server/native-hook-relay.test.ts extensions/codex/src/app-server/plugin-thread-config.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts extensions/codex/src/app-server/run-attempt.test.ts
  • git diff --check
  • rg -n "features\\.codex_hooks|codex_hooks" extensions/codex src packages docs test -g '!node_modules'

Real Behavior Proof

Behavior addressed: OpenClaw-generated Codex app-server thread config no longer injects the deprecated features.codex_hooks key for native hook relay setup or clearing.

Real environment tested: Local OpenClaw source checkout on macOS with codex-cli 0.129.0; codex features list reports hooks stable true and does not list codex_hooks.

Exact steps or command run after this patch: Ran the focused Codex extension Vitest command above against the four affected app-server test files.

Evidence after fix: buildCodexNativeHookRelayConfig() and buildCodexNativeHookRelayDisabledConfig() now emit features.hooks; the app-server tests assert the new key through native relay, thread lifecycle, plugin config merging, start, and resume paths.

Observed result after fix: 4 test files passed with 159 tests passed.

What was not tested: Did not rebuild and install the npm package or manually reopen the Codex desktop Settings screen from an installed OpenClaw package.

@clawsweeper

clawsweeper Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR changes Codex app-server native hook relay config and related tests from features.codex_hooks to features.hooks.

Reproducibility: yes. source-level reproduction is high confidence: current main generates features.codex_hooks, while the pinned upstream Codex contract marks hooks as the stable key and codex_hooks as a legacy alias. I did not run an installed Settings UI repro in this read-only review.

Real behavior proof
Not applicable: The external-contributor proof gate does not apply to this maintainer-labeled member PR, though the PR body includes useful local Codex feature-list and focused test evidence.

Next step before merge
No repair lane is needed: the patch looks correct and the remaining action is normal maintainer validation and merge handling.

Security
Cleared: The diff only renames a generated Codex feature flag and test expectations; it adds no dependencies, scripts, workflow permissions, secrets handling, or new execution path.

Review details

Best possible solution:

Merge the narrow flag rename after normal maintainer checks, keeping the Codex dependency-specific hook contract inside the Codex plugin.

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

Yes, source-level reproduction is high confidence: current main generates features.codex_hooks, while the pinned upstream Codex contract marks hooks as the stable key and codex_hooks as a legacy alias. I did not run an installed Settings UI repro in this read-only review.

Is this the best way to solve the issue?

Yes. Replacing only the generated native hook relay feature key and updating the affected tests is the narrowest maintainable fix for the upstream Codex feature-flag contract.

What I checked:

  • Current main still emits the legacy key: On current main, buildCodexNativeHookRelayConfig() emits features.codex_hooks: true and the disabled config emits features.codex_hooks: false. (extensions/codex/src/app-server/native-hook-relay.ts:30, a099acc557e0)
  • Config reaches Codex thread start/resume path: The run attempt builds native hook relay config and merges it into the thread config passed to the Codex app-server lifecycle. (extensions/codex/src/app-server/run-attempt.ts:727, a099acc557e0)
  • Dependency contract checked: OpenClaw pins @openai/codex 0.130.0, and upstream Codex rust-v0.130.0 declares the canonical Codex hooks feature key as hooks, stable, default-enabled; codex_hooks is only a legacy alias. (extensions/codex/package.json:12, a099acc557e0)
  • PR scope is focused: The live PR file list contains only five Codex app-server source/test files, with 23 additions and 23 deletions replacing the feature flag key in the generated config and assertions. (b1222c0f73ce)
  • Protected maintainer handling applies: The live PR is open, mergeable, non-draft, and labeled maintainer; the provided context identifies the author association as MEMBER. (b1222c0f73ce)
  • Related search did not supersede this PR: Search found the open native relay availability issue at Native hook relay remains unavailable after gateway restart and hooks report 5/5 ready #73723, but that report concerns missing relay registrations after restart rather than the deprecated Codex feature flag key.

Likely related people:

  • pashpashpash: GitHub commit history shows this user introduced the Codex native hook relay files and the original features.codex_hooks config in the native relay bridge. (role: introduced behavior; confidence: high; commits: 7a958d920c88; files: extensions/codex/src/app-server/native-hook-relay.ts, extensions/codex/src/app-server/run-attempt.ts, extensions/codex/src/app-server/native-hook-relay.test.ts)
  • vincentkoc: Recent history shows this user extended the native relay event set with before_agent_finalize / hooks.Stop behavior in the same files. (role: adjacent feature contributor; confidence: medium; commits: f3accc753cf2; files: extensions/codex/src/app-server/native-hook-relay.ts, extensions/codex/src/app-server/native-hook-relay.test.ts, extensions/codex/src/app-server/run-attempt.test.ts)
  • steipete: Recent Codex app-server history includes trimming Codex internal exports and nearby app-server runtime work touching the affected native relay and run-attempt surfaces. (role: recent area contributor; confidence: medium; commits: 1c76065ccd29, f12e9c41fa15; files: extensions/codex/src/app-server/native-hook-relay.ts, extensions/codex/src/app-server/run-attempt.ts)

Remaining risk / open question:

  • I did not independently run the installed Codex Settings UI path; the PR body also notes that installed-package Settings was not manually reopened.

Codex review notes: model gpt-5.5, reasoning high; reviewed against a099acc557e0.

Re-review progress:

@pash-openai pash-openai merged commit 3de9705 into main May 15, 2026
112 of 116 checks passed
@pash-openai pash-openai deleted the fix/codex-hooks-feature-flag branch May 15, 2026 20:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants