Conversation
💡 Codex Reviewcodex/codex-rs/app-server-protocol/src/protocol/v2.rs Lines 3774 to 3777 in 7d9c354
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
a8d528a to
4eaec7b
Compare
ddf331f to
43daba8
Compare
bb269a5 to
7707752
Compare
7322467 to
9f008e0
Compare
Previous to this change,
determine_action()wouldprogramis associated with a skillprogramis inexecve_session_approvalsto see whether the user needs to be promptedThis PR flips the order of these checks to try to set us up so that "session approvals" are always consulted first (which should soon extend to include session approvals derived from
prefix_rule()s, as well).Though to make the new ordering work, we need to record any relevant metadata to associate with the approval, which in the case of a skill-based approval is the
SkillMetadataso that we can derive thePermissionProfileto include with the escalation. (Though as noted by theTODO, thisPermissionProfileis not honored yet.)The new
ExecveSessionApprovalstruct is used to retain the necessary metadata.What Changed
execve_session_approvalsHashSetwith a map that stores anExecveSessionApprovalalongside each approvedprogram.ApprovedForSessionfor a skill script, capture the matchedSkillMetadatain the session approval entry.find_skill(), and reuse the originally approved skill metadata and permission profile when allowing later execve callbacks in the same session.