Skip to content

Reuse approval policy choices - #133

Merged
delete-cloud merged 1 commit into
mainfrom
feat/approval-policy-constant
May 11, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
feat/approval-policy-constant

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • reuse the shared approval policy choices for local run CLI parsing
  • remove the remaining duplicate approval policy literal list in main.py

Validation

  • uv run pytest tests/cli/ -q
  • uv run basedpyright --level error src/coding_agent/main.py
  • uv run ruff format src/coding_agent/main.py
  • git diff --check

Summary by CodeRabbit

  • Improvements
    • Approval policy options for batch runs are now dynamically sourced from system configuration instead of using a fixed set of hardcoded values, enabling greater flexibility in defining available approval policies.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 139f792e-dd00-45cb-9bff-4a6ea1bf5c27

📥 Commits

Reviewing files that changed from the base of the PR and between 00a73f2 and 8712804.

📒 Files selected for processing (1)
  • coding-agent/src/coding_agent/__main__.py

📝 Walkthrough

Walkthrough

The run subcommand's --approval CLI option is updated to use REMOTE_APPROVAL_CHOICES from APPROVAL_POLICIES instead of a hardcoded list of choices, ensuring the CLI accepts whatever approval policies are defined in the system.

Changes

Approval Policy Validation

Layer / File(s) Summary
Approval Option Validation
coding-agent/src/coding_agent/__main__.py
The --approval Click option now validates against REMOTE_APPROVAL_CHOICES (sourced from APPROVAL_POLICIES) instead of the hardcoded ["yolo", "interactive", "auto"] list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

A choice once carved in stone and code,
Now dances free down config's road—
The rabbit's CLI hops along,
With policies both wise and strong. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Reuse approval policy choices' accurately and concisely summarizes the main change: removing duplicate approval policy definitions and reusing a shared constant instead.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/approval-policy-constant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@delete-cloud
delete-cloud merged commit 26c7679 into main May 11, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat/approval-policy-constant branch May 11, 2026 02:59
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.

1 participant