rowboat/apps/x/packages/core/src
PRAKHAR PANDEY 1bfda94f48
fix: suppress notification spam on app re-open (#623)
* fix: suppress notification spam on app re-open

- Add background_task notification category (default ON) so users can
  toggle off background-task pings via Settings → Notifications
- Route notify-user builtin through notifyIfEnabled gate so the
  category toggle takes effect
- Add 60s startup grace period: background-task notifications fired
  within 60s of launch are suppressed, killing the reopen flood where
  all queued agents complete at once
- Suppress new_email notifications for emails older than 5 min so
  Gmail's startup backlog replay doesn't surface day-old mail

Fixes both issues reported by Ramnique.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: skip automatic chat_completion ping for background task agents

Background task runs were triggering "Response ready / Your agent
finished responding" on every completion. Skip the automatic
chat_completion notification when finalState.runUseCase ===
'background_task_agent' — background tasks notify explicitly via
notify-user when they have something worth surfacing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: correct notification deeplinks and skip internal agent pings

- runtime.ts: also skip chat_completion ping for knowledge_sync
  useCase (agent_notes_agent was opening notes view on click)
- sync_gmail.ts: new_email notification now links to specific
  email thread (rowboat://open?type=email&threadId=...)
- App.tsx: add email case to parseDeepLink, parse threadId param,
  wire threadId through applyViewState, update viewStatesEqual

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: distinguish background-agent notifications from auto knowledge-sync

Per team clarification, two background types are handled differently:
- knowledge_sync (auto knowledge-graph generation): never notifies;
  skips the generic chat_completion ping entirely.
- background_task_agent (user-configured agents): notifies via its
  own notify-user path, gated behind the toggleable "Background
  agents" category, deep-linking to the background-tasks page.

- runtime.ts: skip the generic chat_completion completion ping for
  both knowledge_sync and background_task_agent (the latter notifies
  via notify-user, so the generic ping would duplicate it).
- builtin-tools.ts: notify-user branches on getCurrentUseCase() —
  background agents route through notifyIfEnabled('background_task')
  with a bg-tasks deeplink default; chat agents notify directly.
- App.tsx: add the bg-tasks deeplink target (ViewState, parseDeepLink,
  applyViewState, currentViewState).
- settings-dialog.tsx: rename the category label to "Background agents".
- runner.ts: wrap the background-task run in withUseCase so tools see
  the correct use-case context.

* fix: route coding-session notifications through notifyIfEnabled

Code-mode status-tracker was calling notificationService.notify() directly,
bypassing the user's notification-category toggles. Routed both calls
through notifyIfEnabled() with correct categories:
- needs-you state → agent_permission
- idle after 30s  → chat_completion

Removed now-redundant container/INotificationService plumbing.

* fix: fall back to persisted run useCase when ALS context is missing in notify-user

AsyncLocalStorage does not propagate across the background-task agent's
async generator — getCurrentUseCase() returns undefined inside notify-user,
causing the background_task_agent branch to be skipped and the Background
agents toggle to be ignored.

Fix: load persisted useCase from run record via fetchRun(ctx.runId) when
ALS is falsy. Lazy dynamic import() avoids the known module-init cycle.
Background-agent notifications now correctly respect the toggle and only
fire when the app is in the background, with deep link to the bg-tasks page.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 01:36:06 +05:30
..
account use rowboat model gateway when logged in 2026-03-12 23:29:42 +05:30
agent-schedule add posthog analytics for llm usage and auth events 2026-04-28 19:53:40 +05:30
agents fix: suppress notification spam on app re-open (#623) 2026-06-24 01:36:06 +05:30
analytics feat(billing): consume plan variant catalog 2026-06-19 16:52:22 +05:30
application fix: suppress notification spam on app re-open (#623) 2026-06-24 01:36:06 +05:30
auth Drive (#583) 2026-06-23 03:13:58 +05:30
background-tasks fix: suppress notification spam on app re-open (#623) 2026-06-24 01:36:06 +05:30
billing feat(billing): consume plan variant catalog 2026-06-19 16:52:22 +05:30
code-mode fix: suppress notification spam on app re-open (#623) 2026-06-24 01:36:06 +05:30
composio feat: native google sign-in for signed-in users 2026-05-05 14:29:13 +05:30
config feat: add user-configurable notification settings (#601) 2026-06-11 19:43:26 +05:30
di add code mode: coding-agent workspace with sessions, direct/Rowboat drive, diffs, and worktrees 2026-06-12 23:57:44 +05:30
events send LLM use-case metadata through Rowboat gateway 2026-05-20 07:11:06 +05:30
filesystem Refactor builtin file tools beyond workspace scope 2026-05-25 16:21:51 +05:30
knowledge fix: suppress notification spam on app re-open (#623) 2026-06-24 01:36:06 +05:30
local-sites Iframe (#502) 2026-04-18 12:10:40 +05:30
mcp remove default exa server 2026-03-19 18:46:08 +05:30
migrations feat: native google sign-in for signed-in users 2026-05-05 14:29:13 +05:30
models fix(onboarding): filter non-chat models from provider list using models.dev 2026-06-22 12:49:48 +05:30
pre_built email reply all and first name signoff 2026-06-20 02:32:08 +05:30
runs Last modified (#624) 2026-06-17 10:21:24 +05:30
schedule feat: background tasks 2026-05-12 17:43:25 +05:30
search Add global search across knowledge and chats 2026-02-18 18:08:24 +05:30
security Add run-level auto permission mode 2026-06-03 07:58:04 +05:30
services code clean up 2026-02-06 23:17:32 +05:30
slack feat: ship Slack as a knowledge source, hardened for production (#596) 2026-06-17 12:52:27 -07:00
voice fix workdir everywhere (#475) 2026-04-10 10:40:46 +05:30
workspace add code mode: coding-agent workspace with sessions, direct/Rowboat drive, diffs, and worktrees 2026-06-12 23:57:44 +05:30
index.ts voice mode with TTS input/output 2026-03-13 10:39:05 +05:30