feat(hooks): add Codex hook#2973
Open
maxdestors wants to merge 2 commits into
Open
Conversation
|
I asked Codex to do this globally, for old and new chats; it worked: rtk gain Total commands: 858 By Command Command Count Saved Avg% Time Impact───────────────────────────────────────────────────────────────────────
|
Update permissions.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Because Codex only supports
allow, we auto-allow only simple, read-only commands from a fixed whitelist:git/yadm:status,log,diff,showcat,head,tail,ls,tree,grep,wcEverything else falls back to Codex’s native approval flow.
Partially closes #1003 and checked the work on #1550.
More work needs to be done once Codex support full rewriting.
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk <command>output inspectedI also installed it in my current WSL vscode setup and it works well. The hook must be trusted.
Also to have
rtk gain --historyshow the commands you have to add thoses lines to~/.codex/config.toml: