Skip to content

Notification Center

Aggregates events across the extension — git, MCP, agent, PR review, and more — into one queryable feed. Persisted to SQLite so it survives restarts.

SourceExamples
SystemActivation, updates, config changes
CommandsCommand execution results, errors
GitBranch switches, merge conflicts, commit results
ChatModel switches, context window warnings
MCPServer connect/disconnect, tool registration
Model ManagerModel downloads, Ollama status changes
WorkspaceFile indexing progress, analysis completion
GitLabPipeline status, merge request updates
JiraIssue status changes, assignments
PR ReviewReview completion, comments, approval
AgentTask completion, errors, checkpoint creation
TypeIcon colorUse case
infoBlueOperation completed successfully
warningYellowAttention needed — degraded perf, retries
errorRedFailure — intervention needed
successGreenPositive result — test passed, deploy succeeded

30-second window. Same type + title combo within 30 s → the second notification is silently suppressed. Prevents flooding from rapid events (file watcher, retry loops).

Dedup map capped at 200 entries. Cap reached → stale entries (> 30 s old) pruned.

SQLite via SqliteDatabaseService:

CREATE TABLE notifications (
id INTEGER PRIMARY KEY AUTOINCREMENT,
type TEXT NOT NULL,
title TEXT NOT NULL,
message TEXT NOT NULL,
source TEXT,
read_status INTEGER DEFAULT 0,
timestamp TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
);

Notifications survive restarts, are SQL-queryable (by source, type, read status), and the webview loads the full history on panel open.

Cap: 500 entries. Pruning runs at most once every 5 min:

  1. Count total.
  2. If > 500, delete oldest (count − 500) entries.
  3. Deletion uses subquery ORDER BY timestamp ASC LIMIT ....

Add:

await notificationService.addNotification(
"success",
"Tests passed",
"All 42 tests passed in 3.2s",
NotificationSource.Agent,
);

Query:

const notifications = await notificationService.getNotifications(50);
const unread = await notificationService.getUnreadCount();

Mark:

await notificationService.markAsRead(notificationId);
await notificationService.markAllAsRead();

onDidNotificationChange fires on add / read / clear. Webview panel subscribes for real-time updates.

Chat UI subscribes to the event stream. Renders a scrollable list with source badges (color-coded), relative timestamps (“2 minutes ago”), read/unread indicators, dismiss, and “mark all as read”.