Skip to content

feat(hook): add Codex command rewriting - #2927

Closed
paranoa233 wants to merge 1 commit into
rtk-ai:developfrom
paranoa233:feat/codex-hook-support
Closed

paranoa233 wants to merge 1 commit into
rtk-ai:developfrom
paranoa233:feat/codex-hook-support

Conversation

@paranoa233

Copy link
Copy Markdown

Summary

  • add a native rtk hook codex processor for Codex PreToolUse payloads
  • install the hook in global or project hooks.json without overwriting existing hooks
  • make installation idempotent, remove only RTK's entry on uninstall, and report hook status
  • update Codex integration and hook architecture documentation

Why

Codex currently receives prompt-level RTK guidance but cannot transparently rewrite supported shell commands. This adds the same automatic path while using Codex's native updatedInput.command protocol.

Impact

  • unsupported, malformed, or non-Bash payloads emit no output and remain non-blocking
  • rewritten input preserves other tool_input fields
  • accepting the rewrite does not replace Codex's normal sandbox and approval checks
  • existing user hook configuration is preserved

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets
  • cargo test (2,447 unit tests plus integration suites)
  • manual stdin smoke test for rewrite and pass-through behavior

Part of #2921. Paired with #2926.

@CLAassistant

CLAassistant commented Jul 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@KuSh

KuSh commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Closing in favour of #3552, which covers the same Codex PreToolUse integration, is the version a collaborator has reviewed, and uses the transparent updatedInput path that Codex now applies end to end. Thanks for the work here. Please take anything your branch handles that #3552 misses to that thread so the effort stays in one place.

@KuSh KuSh closed this Sep 6, 2026
@KuSh KuSh added the duplicate This issue or pull request already exists label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants