feat(codex): add PreToolUse hook support#2033
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: BEOKS <lee01042000@gmail.com>
|
Hey @BEOKS Thanks for addressing this, here is a review for this to be valid. Still open to this and discuss Blocking question: updatedInput rewrite is unverified end-to-end (version-dependent silent failure)Value of this PR rests on one link in the chain: RTK emits an allow decision carrying the rewritten updatedInput command. RTK emitting the correct payload is verifiable (and the unit tests confirm it), but Codex honoring it is not verified anywhere in this PR, and had issues in the past. Why there's genuine doubt:
So the behavior is version-dependent: deny is the old, universally-supported primitive, while updatedInput-apply is newer and only stabilized later. What I'd like to confirm before this can be considered valid:
Happy to discuss how to handle it; handling falls back when updatedInput isn't honored would be the best options. Open to your take. In anyway, the RTK context when init should tell to prefix "rtk" with some examples, but we want to aim full transparency at best, so at one point, we hope we will be able to remove totally this context driven RTK rewrite. I do not like and deny and retry approach because it will cost API more tokens and is against our transparency principle. Design note: Cross-agent permission leakage (Claude's deny rules silently govern Codex)process_codex_payload calls permissions::check_command(), which (src/hooks/permissions.rs:92–98, 145–155) loads deny/ask/allow rules only from .claude/settings.json / ~/.claude/settings.json Consequences in a Codex session:
Aware of current state in other integrations I'm aware that this is also case for other current integrations that can inherit from this, this may become a design issue once most of agent have their permissions system, if you agree with this we could maybe avoid replicating this here as well. Permissions systemCodex have its own decision system we should use transparently, RTK should not interfer with any usage of CLI and reflect the original behavior at best.
SummaryI have still few things to note here, but let's try solve this first and then we'll move forward :) Thanks for contributing to RTK ! |
Summary
Testing