fix(notifications): show approve/deny for scope-request notifications in bell#2107
fix(notifications): show approve/deny for scope-request notifications in bell#2107hognek wants to merge 2 commits into
Conversation
…s in bell and toast PR jaylfc#1921 (agent scope-requests) emits notifications with source 'agent_scope_requests' but NotificationCentre and NotificationToast only rendered ConsentActions for source === 'auth_requests'. Scope- request approve/deny was invisible in the UI. - Branch source check in NotificationCentre and NotificationToast to also accept 'agent_scope_requests' - ConsentActions now accepts optional source + canonicalId props and routes approve/deny to the scope-request endpoints when source is 'agent_scope_requests' (/api/agents/registry/{id}/scope-requests/...) - consentPayload() extracts canonical_id from notification data for the scope-request endpoint path - Backward compatible: source defaults to 'auth_requests' for existing callers (DecisionsApp, tests) Ref: jaylfc#1921
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughConsent notifications now recognize ChangesConsent scope-request flow
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant NotificationCentre
participant NotificationToast
participant ConsentActions
participant ConsentAPI
NotificationCentre->>ConsentActions: pass source and canonicalId
NotificationToast->>ConsentActions: pass source and canonicalId
ConsentActions->>ConsentAPI: approve or deny using selected endpoint
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: 1
🤖 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 `@desktop/src/components/ConsentActions.tsx`:
- Around line 140-143: Update the URL construction and action handling in
ConsentActions so agent_scope_requests requires a non-empty canonicalId before
proceeding; reject or disable the approval/denial action when it is missing, and
never substitute requestId for the registry path segment. Preserve the
requestId-based URL behavior for auth requests only.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a4ecf06d-cfbe-4167-a84b-c208adc2bf2b
📒 Files selected for processing (3)
desktop/src/components/ConsentActions.tsxdesktop/src/components/NotificationCentre.tsxdesktop/src/components/NotificationToast.tsx
Per CodeRabbit review: the canonicalId ?? requestId fallback could produce
malformed URLs like /registry/{requestId}/scope-requests/... when
canonical_id is missing from the notification data. Now explicitly
rejects scope-request approve/deny with a clear error when the
canonicalId is absent.
Fixes scope-request notification UI gap from #1921.
Problem
PR #1921 (agent scope-requests) emits notifications with
source: "agent_scope_requests", butNotificationCentreandNotificationToastonly renderConsentActions(approve/deny buttons) forsource === "auth_requests". Scope-request approve/deny was invisible in the UI — approving required hand-rolled curl.Fix
NotificationCentre.tsxandNotificationToast.tsxto also match"agent_scope_requests"ConsentActionsaccepts optionalsource(defaults to"auth_requests") andcanonicalIdprops; routes approve/deny to the scope-request endpoints (/api/agents/registry/{id}/scope-requests/{req_id}/approve|deny) when source is"agent_scope_requests"consentPayload()extractscanonical_idfrom notification data for scope-request endpoint path constructionsource="auth_requests"defaultFiles
desktop/src/components/ConsentActions.tsx— added source/canonicalId props + URL branching + consentPayload canonicalId extractiondesktop/src/components/NotificationCentre.tsx— branched source check + passes source/canonicalIddesktop/src/components/NotificationToast.tsx— sameTests
npm run buildpasses (tsc + vite build)vitest run ConsentActions.test.tsx— 7/7 pass (backward compatibility confirmed)Ref: #1921 — PR adding scope-request flow
Summary by CodeRabbit