Skip to content

feat: add remote approval scope choices - #121

Merged
delete-cloud merged 1 commit into
mainfrom
feat-adr-0019-remote-approval-scope
May 9, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
feat-adr-0019-remote-approval-scope

Conversation

@delete-cloud

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

Copy link
Copy Markdown
Owner

Summary

  • add remote CLI approval choices for approve-once, approve-for-session, and reject-with-reason in src/coding_agent/remote/client.py
  • add focused CLI regression coverage for remote approval prompt payloads and rendered prompt text
  • capture the slice in ADR-0019 task packet adr-0019-pr8-remote-approval-scope.md

Verification

  • uv run pytest tests/cli/test_remote_client.py -k \"approval_request or formats_approval\" -v
  • uv run pytest tests/ui/test_http_server.py -k \"approval and session\" -v
  • uv run basedpyright --level error src/coding_agent/remote/client.py tests/cli/test_remote_client.py
  • manual CLI QA via tmux: verified a returns _ApprovalDecision(... scope='session') and invalid input falls back to _ApprovalDecision(approved=False, feedback='Rejected by user', scope='once')

Summary by CodeRabbit

Release Notes

  • New Features
    • Enhanced remote approval workflow with expanded scope options: approve once, approve entire session, reject, or reject with reason
    • Improved feedback collection for rejection decisions

Review Change Stack

Remote attach and repl needed parity with the local approval UI so users can approve once, approve for the session, or reject with feedback from the CLI.
@coderabbitai

coderabbitai Bot commented May 9, 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: 6f1a46d6-02ea-4d0b-b676-cf660a339d44

📥 Commits

Reviewing files that changed from the base of the PR and between 204ddbd and ea2045a.

📒 Files selected for processing (3)
  • coding-agent/.opencode/prompts/tasks/adr-0019-pr8-remote-approval-scope.md
  • coding-agent/src/coding_agent/remote/client.py
  • coding-agent/tests/cli/test_remote_client.py

📝 Walkthrough

Walkthrough

This PR enhances the remote client approval flow to support session-scope approval decisions and structured rejection feedback. The implementation replaces binary yes/no prompts with multi-option CLI prompts that allow users to approve once, approve for the entire session, reject, or reject with a reason. The approval decision now includes scope and feedback fields tracked through the submission payload.

Changes

Remote Approval Scope Enhancement

Layer / File(s) Summary
Architecture & Requirements
coding-agent/.opencode/prompts/tasks/adr-0019-pr8-remote-approval-scope.md
ADR-0019 defines the remote approval scope: in-scope client UX enhancements to capture session-scope approval and rejection feedback; explicitly out-of-scope are HTTP schema and session-manager coordination.
Multi-Option Approval Prompt
coding-agent/src/coding_agent/remote/client.py
_prompt_for_approval replaces click.confirm with multi-choice click.prompt supporting approve-once (y/yes), approve-session (a/all), reject (n), and reject-with-reason (r/reason). Returns _ApprovalDecision with scope (once/session) and feedback fields.
Approval Request Tests
coding-agent/tests/cli/test_remote_client.py
Tests updated to mock click.prompt instead of click.confirm, validate scope and feedback in approval payloads. New test covers rejecting with user-provided reason. Adjusted inline-stream approval test to expect new prompt behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • delete-cloud/Coding-Agent-Loop#116: Both PRs modify the remote client approval flow in coding_agent/remote/client.py with changes to ApprovalRequest prompts and related test behavior.
  • delete-cloud/Coding-Agent-Loop#95: This PR's client-side scope and feedback fields in _ApprovalDecision directly complement PR #95's server-side approval_decision payload handling with matching field semantics.

Poem

🐰 A prompt so wise, with many ways to choose—
Approve once, or the session too,
Reason for rejection, feedback clear,
The scope decision triumphs here! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add remote approval scope choices' directly aligns with the main changes: implementing multi-option approval scope selection (approve-once, approve-for-session, reject-with-reason) in the remote client.
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-adr-0019-remote-approval-scope

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 0253d7d into main May 9, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat-adr-0019-remote-approval-scope branch May 9, 2026 16:54
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