Repository navigation
Expose remote run approval policy - #131
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR adds CLI-configurable remote tool approval policy ( ChangesRemote Approval Policy Configuration
Sequence DiagramsequenceDiagram
participant CLI as remote run
participant Handler as remote_run handler
participant Workflow as _remote_run_once
participant Session as create_remote_session
participant API as /sessions endpoint
CLI->>Handler: --approval yolo
Handler->>Workflow: approval_policy="yolo"
Workflow->>Session: approval_policy="yolo"
Session->>Session: validate("yolo" in choices)
Session->>API: POST {approval_policy: "yolo"}
API-->>Session: session created
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
coding-agent/src/coding_agent/remote/client.py (1)
127-130: ⚡ Quick winCentralize approval-policy literals to prevent drift
{"auto", "interactive", "yolo"}is now defined here and separately in CLI option choices. Consider using a single shared constant/module so validation and CLI parsing can’t diverge later.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@coding-agent/src/coding_agent/remote/client.py` around lines 127 - 130, The approval-policy literals are duplicated; create a single exported constant (e.g., APPROVAL_POLICIES = {"auto","interactive","yolo"}) in a shared module and import it into this file, then replace the inline set used in the approval_policy check with that constant (the validation in the function taking approval_policy: str should use APPROVAL_POLICIES), and update the CLI option choices to reference the same constant so validation and CLI parsing cannot diverge.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@coding-agent/src/coding_agent/__main__.py`:
- Around line 529-536: You added a new CLI flag (--approval mapped to
approval_policy using REMOTE_APPROVAL_CHOICES) in coding_agent.__main__ which
changes entrypoint behavior; run the entire tests/cli/ test suite (not just
test_remote_client.py) locally or in CI to ensure no regressions, address any
failing tests (e.g., update tests that expect prior defaults or adjust CLI
parsing in __main__.py, approval_policy handling, or REMOTE_APPROVAL_CHOICES),
and re-run until all tests in tests/cli/ pass before merging.
In `@coding-agent/tests/cli/test_remote_client.py`:
- Around line 1751-1754: The test currently only asserts the message prefix via
pytest.raises(..., match="Remote approval requires input"); update the match to
assert the actionable guidance is present too by using a regex that requires
both the example flag and the input source (e.g. include "--approval yolo" and
"stdin"); locate the pytest.raises call in the test and replace the simple
string match with a regex that ensures the message contains both actionable
parts.
---
Nitpick comments:
In `@coding-agent/src/coding_agent/remote/client.py`:
- Around line 127-130: The approval-policy literals are duplicated; create a
single exported constant (e.g., APPROVAL_POLICIES =
{"auto","interactive","yolo"}) in a shared module and import it into this file,
then replace the inline set used in the approval_policy check with that constant
(the validation in the function taking approval_policy: str should use
APPROVAL_POLICIES), and update the CLI option choices to reference the same
constant so validation and CLI parsing cannot diverge.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d6eaa8e4-03b2-4b06-b3d3-3d2307ad6017
📒 Files selected for processing (4)
coding-agent/docs/remote-sandbox-production.mdcoding-agent/src/coding_agent/__main__.pycoding-agent/src/coding_agent/remote/client.pycoding-agent/tests/cli/test_remote_client.py
Summary
Validation
Summary by CodeRabbit
Release Notes
New Features
--approvalCLI option toremote runandremote replcommands with three configurable modes:auto,interactive, andyolo.Documentation
--yesflag usage.