Skip to content

Conversation

@zhao-oai
Copy link
Collaborator

@zhao-oai zhao-oai commented Nov 20, 2025

this PR enables TUI to approve commands and add their prefixes to an allowlist:
Screenshot 2025-11-21 at 4 18 07 PM

note: we only show the option to whitelist the command when

  1. command is not multi-part (e.g git add -A && git commit -m 'hello world')
  2. command is not already matched by an existing rule

@zhao-oai zhao-oai changed the base branch from main to pr7032 November 20, 2025 21:48
@zhao-oai zhao-oai force-pushed the pr7032 branch 3 times, most recently from 683bc5f to 1273f94 Compare November 20, 2025 22:16
@zhao-oai zhao-oai force-pushed the pr7033 branch 3 times, most recently from 90204c3 to 67afce9 Compare November 21, 2025 00:26
@zhao-oai
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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 {
Copy link
Collaborator Author

@zhao-oai zhao-oai Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@zhao-oai zhao-oai changed the title Add approval allow-prefix flow in core and tui allow-prefix integration in core and tui Nov 21, 2025
@zhao-oai zhao-oai changed the title allow-prefix integration in core and tui whitelist command prefix integration in core and tui Nov 21, 2025
@zhao-oai zhao-oai requested a review from bolinfest November 21, 2025 22:18
@zhao-oai
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants