Repository navigation
Add result-focused agent notification mode - #19887
hbjk1030-cmyk wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughAdds the Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to The new mode control is visible but disabled until Agent Task Complete is enabled, which is a minor settings UX mismatch. Notification behavior is otherwise ready to merge with bounded follow-up. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 25 files. (2 skipped: 2 unsupported.)
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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 73e93dfa-3cb1-4da3-b0f7-398119f23047
📒 Files selected for processing (27)
docs/site/content/docs/notifications.mdxsrc/main/ipc/notifications-delivery-gating.test.tssrc/main/ipc/notifications-mobile-fanout.test.tssrc/main/ipc/notifications.tssrc/main/persistence/applying-settings/onboarding-normalization.test.tssrc/main/persistence/applying-settings/onboarding-normalization.tssrc/renderer/src/components/activity/activity-event-build-cache.tssrc/renderer/src/components/activity/activity-event-builder-sources.tssrc/renderer/src/components/activity/activity-event-builder.live-cap.test.tssrc/renderer/src/components/activity/activity-event-builder.tssrc/renderer/src/components/activity/activity-pane-events.tssrc/renderer/src/components/activity/use-agent-pane-threads.tssrc/renderer/src/components/settings/AgentNotificationModeSetting.tsxsrc/renderer/src/components/settings/NotificationsPane.test.tsxsrc/renderer/src/components/settings/NotificationsPane.tsxsrc/renderer/src/components/settings/notifications-search.tssrc/renderer/src/components/terminal-pane/use-notification-dispatch.test.tssrc/renderer/src/components/terminal-pane/use-notification-dispatch.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/agent-status-batch.test.tssrc/renderer/src/store/slices/agent-status-live-entry-builder.tssrc/shared/agent-notification-policy.test.tssrc/shared/agent-notification-policy.tssrc/shared/agent-status-types.tssrc/shared/constants.tssrc/shared/notification-settings-types.tstests/e2e/notification-settings.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| } | ||
| /> | ||
|
|
||
| <AgentNotificationModeSetting |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Render the mode setting only when agent task notifications are enabled.
AgentNotificationModeSetting is visible when agentTaskComplete is false. The required behavior is to reveal this setting after the user enables Agent Task Complete. Wrap this component in an agentTaskComplete condition.
Proposed fix
- <AgentNotificationModeSetting
- value={notificationSettings.agentNotificationMode ?? 'all'}
- disabled={!notificationSettings.enabled || !notificationSettings.agentTaskComplete}
- onChange={(agentNotificationMode) =>
- void updateNotificationSettings({ agentNotificationMode })
- }
- />
+ {notificationSettings.agentTaskComplete ? (
+ <AgentNotificationModeSetting
+ value={notificationSettings.agentNotificationMode ?? 'all'}
+ disabled={!notificationSettings.enabled}
+ onChange={(agentNotificationMode) =>
+ void updateNotificationSettings({ agentNotificationMode })
+ }
+ />
+ ) : null}There was a problem hiding this comment.
Important
The classifier has no signal for an agent that crashes (or exits without emitting done), so crashes are classified as progress and silently suppressed in the new opt-in mode — the mode misses the exact "failure" it promises to surface.
Reviewed changes
- New shared policy —
classifyAgentNotificationIntentandshouldSurfaceAgentNotificationinsrc/shared/agent-notification-policy.ts, plus an optionalagentNotificationModesetting ('all'|'results-and-actions') defaulting to'all'. - Policy applied at every delivery surface — before Activity unread state, renderer dispatch, and main-process tray/native/mobile delivery, while preserving terminal bell, test notifications, and manual Mark Unread.
- Intent persisted on history —
notificationIntentcaptured onAgentStateHistoryEntryat transition time so past rows keep classifying correctly after live fields are cleared. - Settings UI, i18n, docs, and tests — new
AgentNotificationModeSettingselect, search metadata,en.jsonentries, docs, and unit/integration/E2E coverage.
The classification logic is clean and well-tested, and the policy is applied consistently across the renderer and main-process boundaries with correct cache-key invalidation and a safe legacy fallback when the setting is absent. One gap is flagged inline.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| } | ||
| const agentNotificationIntent = | ||
| event.source === 'agent-task-complete' | ||
| ? classifyAgentNotificationIntent(agentStatus) |
There was a problem hiding this comment.
An agent that crashes (or exits without emitting done) is classified as progress and silently suppressed in result-focused mode. When agentCompletionSource === 'process-exit' and the stored status is still working, agentStatus is forced to undefined, so classifyAgentNotificationIntent returns progress and this early return drops the OS notification, sound, and markWorktreeUnread. The most common real failure for a non-orchestrated agent therefore produces zero attention in a mode whose purpose is to surface failures.
Technical details
# Process-exit completions are classified `progress`, not `failure`
## Affected sites
- src/renderer/src/components/terminal-pane/use-notification-dispatch.ts:112 — `agentStatus` is forced to `undefined` for `process-exit` when the stored status isn't `done`
- src/renderer/src/components/terminal-pane/use-notification-dispatch.ts:127 — `classifyAgentNotificationIntent(undefined)` returns `progress`
- src/shared/agent-notification-policy.ts:41 — `!entry` (and a non-orchestrated `working`) falls through to `progress`
## Required outcome
- A confirmed process exit with no `done` hook should surface in result-focused mode (as `failure`), or at minimum not be silently dropped when the stored entry's `orchestration.dispatchStatus === 'failed'`.
## Suggested approach (optional)
- In `dispatchTerminalNotification`, when `agentCompletionSource === 'process-exit'` and there is no `done` snapshot, classify from `freshStoredAgentStatus` (which carries `orchestration.dispatchStatus`) instead of `undefined`; and/or add a process-exit-without-`done` branch to `classifyAgentNotificationIntent` returning `failure`.
## Open questions for the human (optional)
- Is a process-exit with no `done` always a failure, or can it be a benign clean exit with a missed hook? If the latter, should it be `failure` only when `orchestration.dispatchStatus === 'failed'`?|
Thank you @hbjk1030-cmyk. A result-focused mode is what we were after too. We shipped it as defaults plus one switch: #36941 adds a separate Agent Needs Input toggle and a phone "Only when an agent needs me" preference, and #36992 stops progress-only turns from announcing "finished". Closing this as superseded. |

ELI5
Orca can keep showing every agent step in Activity while only asking for attention when there is a useful result, a question or approval request, or a failure.
What Changed
Why
Intermediate shell commands, searches, test runs, and waiting transitions are useful history, but they should not interrupt users who only want results or situations requiring action. A structured policy keeps those rows visible while consistently suppressing their attention side effects without brittle message-text matching.
Linked Issue
Fixes #19880
Visual Proof
The screenshots use synthetic E2E settings state and contain no private task content.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
pnpm lint: pass
pnpm typecheck: pass
pnpm build: pass on macOS
Focused notification suite: 94/94 pass across 8 files
Notification settings Electron E2E: 1/1 pass
Full Vitest suite: 77,878 pass, 388 skip, 5 fail. The same five failures reproduce unchanged on the baseline worktree and depend on the local shell / installed Claude CLI: one shell recipe cleanup assertion, two real Claude structured CLI expectations, one Claude trust prompt integration, and one installed Claude path expectation.
AI Disclosure
Implemented and reviewed with OpenAI Codex (GPT-5).
Review
Agent skill upstream boundary
Notes
No new security, platform, remote SSH, or backward-compatibility issue found in self-review. The feature is opt-in; existing users retain the current notification behavior.
Checklist
Author
X (Twitter): N/A