Skip to content

Add system notifications for agent completion#198

Merged
DeadWaveWave merged 1 commit intoDeadWaveWave:mainfrom
Xinyuexyyyyy:agent-system-notifications
Apr 28, 2026
Merged

Add system notifications for agent completion#198
DeadWaveWave merged 1 commit intoDeadWaveWave:mainfrom
Xinyuexyyyyy:agent-system-notifications

Conversation

@Xinyuexyyyyy
Copy link
Copy Markdown
Contributor

@Xinyuexyyyyy Xinyuexyyyyy commented Apr 28, 2026

💡 Change Scope

  • Small Change: Fast feedback, localized UI/logic, low-risk.
  • Large Change: New feature, cross-boundary logic, runtime-risk (persistence, IPC, lifecycle, recovery).

📝 What Does This PR Do?

Adds native system notifications for agent completion/standby events while preserving the existing in-app banner behavior.

  • Adds a validated system:show-notification IPC path and preload/browser API.
  • Reuses the existing agent standby notification watcher so completion events remain deduped by session.
  • Formats native notification text with workspace, task, and space context.
  • Suppresses real OS notifications in test runs to avoid CI/E2E notification popups.
  • Updates notification settings copy from banner-only wording to completion alert wording.

Cross-platform behavior

This is intended to work on all three supported desktop platforms: macOS, Windows, and Linux.

  • Desktop builds use Electron Main process Notification, which routes through the OS notification system on macOS, Windows, and Linux.
  • The API returns { shown: false } when Electron reports notifications are unsupported, so unsupported Linux desktop/session setups fail quietly instead of breaking agent completion handling.
  • Linux support still depends on the user's desktop notification service/session configuration, as with other Electron native notifications.
  • Browser/Web UI fallback uses the Web Notifications API.

I validated the implementation locally on macOS and kept automated tests from emitting real system notifications. Windows/Linux runtime behavior should be checked in platform CI or by maintainers with those desktop environments because this PR does not add platform-specific Windows/Linux E2E notification assertions.


🏗️ Large Change Spec (Required if "Large Change" is checked)

Not applicable. This is a small, localized notification-path change. It does not modify durable state, recovery semantics, or persistence schema.

1. Context & Business Logic

Agent completion is already detected when a session transitions from working to standby. This PR keeps that detection and adds an OS-native notification through Main process IPC.

2. State Ownership & Invariants

  • Renderer owns the existing notification list and session dedupe.
  • Main owns OS notification delivery.
  • Invariant: a session should only enqueue one completion alert for the same standby transition.
  • Invariant: tests must not emit real system notifications.

3. Verification Plan & Regression Layer

  • Unit test covers native notification text formatting.
  • Typecheck covers the new IPC/preload DTO wiring.
  • Existing E2E coverage confirms the standby notification path still works.

✅ Delivery & Compliance Checklist

  • My code passes the ultimate gatekeeper: pnpm pre-commit is completely green.
  • I have signed the CLA if required (see CLA.md).
  • I have included new tests to lock down the behavior (or explicitly stated why it's untestable).
  • I have strictly adhered to the DEVELOPMENT.md architectural boundaries.
  • I have attached a screenshot or screen recording (if this touches the UI).
  • I have updated the documentation accordingly (if adding a feature or changing a contract).

📸 Screenshots / Visual Evidence

Not attached. The native OS notification is suppressed in automated test mode; the existing in-app banner path was verified by E2E.

Verification

  • npx pnpm@9.6.0 test -- --run tests/unit/app/agentStandbySystemNotification.spec.ts tests/unit/contexts/agentConfig.spec.ts
  • npx pnpm@9.6.0 check
  • npx pnpm@9.6.0 lint
  • npx pnpm@9.6.0 build
  • npx pnpm@9.6.0 exec playwright test tests/e2e/workspace-canvas.agent-status-watcher.spec.ts --grep "updates an active agent"

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

@Xinyuexyyyyy Xinyuexyyyyy force-pushed the agent-system-notifications branch from f69b6af to a3706e3 Compare April 28, 2026 15:31
@DeadWaveWave DeadWaveWave merged commit 4614cc3 into DeadWaveWave:main Apr 28, 2026
4 of 7 checks passed
Xinyuexyyyyy added a commit to Xinyuexyyyyy/opencove that referenced this pull request Apr 29, 2026
When Electron's Notification.isSupported() returns false on Linux (e.g.,
missing notification daemon), fall back to using the system notify-send
utility to ensure agent completion notifications are delivered.

Fixes: DeadWaveWave#198
Xinyuexyyyyy added a commit to Xinyuexyyyyy/opencove that referenced this pull request Apr 30, 2026
When Electron's Notification.isSupported() returns false on Linux (e.g.,
missing notification daemon), fall back to using the system notify-send
utility to ensure agent completion notifications are delivered.

Fixes: DeadWaveWave#198
DeadWaveWave pushed a commit that referenced this pull request Apr 30, 2026
* fix: add notify-send fallback for Linux system notifications

When Electron's Notification.isSupported() returns false on Linux (e.g.,
missing notification daemon), fall back to using the system notify-send
utility to ensure agent completion notifications are delivered.

Fixes: #198

* test: stabilize command center space focus e2e
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.

3 participants