feat: auto-run AI review when added as PR reviewer#72
Merged
oddur merged 6 commits intooddur:mainfrom Feb 26, 2026
Merged
Conversation
When a user enables the new "Auto-review when assigned" setting, Gnosis polls GitHub every 5 minutes for PRs where the user is a requested reviewer. Any newly detected review request triggers a background AI review. On completion the review is saved to history and a native OS notification is shown — clicking it opens the completed review directly. - Add `autoReviewOnRequest` preference (default false) - Background poller in main process with 5-minute interval - Persists already-reviewed PR URLs to avoid duplicates across restarts - Native Electron Notification with click-to-open support - `auto-review-ready` IPC event so App.tsx navigates to review - Toggle in Settings dialog
- Don't navigate to review page automatically; the review is saved to history silently and the list refreshes via new-review-in-history - Add unread?: boolean to ReviewHistoryEntry; auto-reviews are saved with unread: true - Blue dot shown on unread history entries, cleared when opened - mark-review-read IPC call wired up on handleLoadFromHistory - Only trigger review for PRs updated within the last 24 h — prevents flooding on first enable with old accumulated review requests - searchPullRequests already filters is:open, so merged/closed PRs are never considered - Notification click just focuses the app (no forced navigation)
Cache the decrypted token after first read so safeStorage.decryptString is only called once per session. Also check cachedLogin before touching the keychain in the background poll loop — the renderer populates it via get-auth-state on load, so our timer never needs to unlock the keychain independently.
safeStorage.isEncryptionAvailable() makes its own Keychain API call on macOS, triggering a prompt before decryptString() triggers another. Fix: remove the pre-check and instead try decryptString() directly with a try/catch fallback to plaintext. Also ensure the background poll timer never calls loadStoredToken() at all — it now checks cachedToken/cachedLogin (populated by the user's normal auth IPC flow) and returns early if either is absent.
Resolved conflicts in lib/types.ts, src/preload.ts, components/SettingsDialog.tsx, and src/main.ts. - types.ts: merged unread? with upstream's prState/prHeadSha/StartReviewResult - preload.ts: kept onNewReviewInHistory/markReviewRead alongside upstream's getPrState/getPrFiles - SettingsDialog: kept auto-review toggle alongside upstream's notifications/reviewSignature toggles - main.ts: kept auto-review polling; simplified triggerBackgroundReview to delegate to upstream's runBackgroundGeneration; merged setupAutoUpdater; updated createPendingHistoryEntry to accept unread flag; added our new methods to types.d.ts
Each pending review in the left panel now has a hover-reveal × button to remove it from the list. Dismissals are persisted to localStorage so they survive app restarts.
oddur
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Gnosis now automatically runs an AI review in the background when you are added as a reviewer on a GitHub PR. Completed reviews appear in the history list with a blue dot to indicate they are unread. A native desktop notification is shown when each review is ready.
The Pending reviews panel gains a per-item dismiss button (hover-reveal ×) so you can remove individual PRs from the list without reviewing them. Dismissals persist across restarts.
Why
The manual loop of "get added as reviewer → open Gnosis → paste the PR URL → wait" is friction. This feature closes that loop: Gnosis watches for new review requests every 5 minutes and does the work automatically, so the review is ready by the time you sit down to look at it.
How
setIntervalcalls the existingsearchPullRequestsGitHub API to find open PRs where the authenticated user is review-requested.seen-review-requests.jsonin userData so the same PR is never reviewed twice, even across restarts.runBackgroundGenerationpipeline (same path as a manual review), then broadcastsnew-review-in-historyto refresh the sidebar.createPendingHistoryEntrygains anunreadflag; opening a review clears it viamark-review-readIPC.cachedToken/cachedLogin— it never touches the macOS keychain from a background timer.localStorageand filtered from the visible list.Screenshots