Repository navigation
Conversation
683bc5f to
1273f94
Compare
9cb7ed0 to
80c63d3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ 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". |
| commands: &[Vec<String>], | ||
| features: &Features, | ||
| ) -> Option<Vec<String>> { | ||
| if features.enabled(Feature::ExecPolicy) && commands.len() == 1 { |
There was a problem hiding this comment.
I don't love the solution I came up with here w.r.t only persisting allow prefix if ExecPolicy is enabled. I think a better solution would be to change the way we store Policy in session state. We should store either an enum indicating whether ExecPolicy is enabled or store Policy as an optional. However, I think this is fit for a followup PR
There was a problem hiding this comment.
Yes, this relates to my long comment above on NeedsApproval.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ 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". |
| @@ -346,7 +348,7 @@ pub(crate) struct SessionConfiguration { | |||
| /// Set of feature flags for this session | |||
| features: Features, | |||
| /// Execpolicy policy, applied only when enabled by feature flag. | |||
| exec_policy: Arc<ExecPolicy>, | |||
| exec_policy: Arc<RwLock<ExecPolicy>>, | |||
There was a problem hiding this comment.
Hmm, this feels slightly undesirable since SessionConfiguration is already generally wrapped in a mutex, but maybe this is OK, I'm not sure yet...
There was a problem hiding this comment.
We will need to update the v2 app server protocol as well, I expect. /cc @owenlin0
There was a problem hiding this comment.
@zhao-oai yes that'd be great if we can keep app-server at feature-parity (but can be done as a followup PR). We'd probably want to add a field here: https://github.com/openai/codex/blob/main/codex-rs/app-server-protocol/src/protocol/v2.rs#L1428 and wire it up
There was a problem hiding this comment.
gotcha. let's do this as a followup
| let approval_requirement = { | ||
| let exec_policy = context.session.current_exec_policy().await; | ||
| create_approval_requirement_for_command( | ||
| &exec_policy, |
There was a problem hiding this comment.
What if instead of adding current_exec_policy(), we just pass &context.exec_policy to create_approval_requirement_for_command()?
Is the issue that context.session.state is held by a tokio::sync::mutex and so we need to clone the values while holding the lock so we can pass them into create_approval_requirement_for_command() because it is not async?
If so, should we make create_approval_requirement_for_command() async?
There was a problem hiding this comment.
OK, merged. Rebase and rejoice!
I think this might help with #7033 because `create_approval_requirement_for_command()` will soon need access to `Session.state`, which is a `tokio::sync::Mutex` that needs to be accessed via `async`.
d23f506 to
312ceb4
Compare
| @@ -346,7 +348,7 @@ pub(crate) struct SessionConfiguration { | |||
| /// Set of feature flags for this session | |||
| features: Features, | |||
| /// Execpolicy policy, applied only when enabled by feature flag. | |||
| exec_policy: Arc<ExecPolicy>, | |||
| exec_policy: Arc<RwLock<ExecPolicy>>, | |||
| commands: &[Vec<String>], | ||
| features: &Features, | ||
| ) -> Option<Vec<String>> { | ||
| if features.enabled(Feature::ExecPolicy) && commands.len() == 1 { |
There was a problem hiding this comment.
Yes, this relates to my long comment above on NeedsApproval.
86b1d98 to
31c5e11
Compare
Add explicit prefix-approval decision and wire it through execpolicy/UI snapshots update doc mutating in memory policy instead of reloading using RW locks clippy refactor: adding allow_prefix into ApprovedAllowPrefix fmt do not send allow_prefix if execpolicy is disabled moving args around cleanup exec_policy getters undo diff fixing rw lock bug causing tui to hang updating phrasing integration test . fix compile fix flaky test fix compile error running test with single thread fixup allow_prefix_if_applicable fix formatting fix approvals test only cloning when needed docs add docstring fix rebase bug fixing rebase issues Revert "fixing rebase issues" This reverts commit 79ce7e1. fix rebase errors
this PR enables TUI to approve commands and add their prefixes to an allowlist:

note: we only show the option to whitelist the command when
git add -A && git commit -m 'hello world')