Repository navigation
Description
Parent: #8147
Summary
Route desktop notifications and task sources through tinyeventqueues on a scheduled cadence, so a notification storm becomes a few batched turns rather than one triage per notification.
Problem
desktop/notifications/ triages each notification individually and in memory. Notifications are the noisiest input we have; they need batching, habituation (repeated near-identical notifications decay) and a budget, which the pipeline already provides.
Solution
- Ingest notifications with
source = notification:<app>, defaulting to a scheduled cadence (e.g.every(10m)) with an ingestion budget; overflow folds into the digest lane. - Salience can promote an urgent notification to
instant. - Same for task sources that currently push straight into triage.
Acceptance criteria
- Batched — regression test with a fake clock: 1,000 notifications in one window produce at most the configured budget of turns per tick, the rest folded into the next tick or the digest.
- Promotion — an urgent notification is delivered without waiting for the tick.
- No silent loss — every notification ends delivered / context / digest / dead / dropped-with-reason, visible in
inbound.stats. - Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by
.github/workflows/ci-fast.yml).
Related
Part of #8147. Builds on #8136 (inbound domain, tinyeventqueues v0.1.2) and tinyhumansai/tinyeventqueues#6.
Audit findings (2026-10-20)
There are two direct triage callers. Each drops a Deferred with only a log line:
- Notifications:
crates/openhuman-core/src/desktop/notifications/rpc.rs:38handle_ingest. It persists viastore::insert_if_not_recent(60 s content dedupe, L70), spawns triage (L92), callsrun_triage(L112) andapply_decision(L187), and drops aDeferredat L217-231. - Task sources:
integrations/task_sources/route.rs:84,93(route_enriched, called fromtask_sources/pipeline.rs:189). It has a per-source(source, external_id, content_hash)ledger (task_sources/store.rs:176).
Other direct callers: skills/webhooks/ops.rs:159,174 (trigger_agent RPC) and agent_runs/schemas.rs:423,438 (triage_evaluate RPC, an explicit evaluation, so it stays direct).
Open PR #8113 touches the task-source dedupe ledger; land it first or fold it in.
Agent brief
Depends on: senamakel#514, senamakel/tinyeventqueues#4 · Blocks: senamakel#515 · Parallel with: #8148, #8149, #8151
Research first
- Whether the 60 s content dedupe in
notifications.dedupshould become the envelope'sdedupe_key(content hash), so it moves into the queue's ingress tombstones and the store copy can go. - Whether the
trigger_agentRPC (skills/webhooks/ops.rs:159) belongs in this leaf. It is a webhook-family direct caller left out of feat(inbound): queue Composio triggers and agent webhooks through tinyeventqueues #8136.
Files to consider
- Read:
crates/openhuman-core/src/desktop/notifications/rpc.rs:38-235,desktop/notifications/store_documents.rs:56,197-330,integrations/task_sources/route.rs:60-110,task_sources/pipeline.rs:150-200 - Change: those callers (ingest via
inbound::route),inbound/events.rs(notification:andtask:envelopes), the handlers ininbound/deliver/ - Tests:
desktop/notifications/*_tests.rs,integrations/task_sources/*_tests.rs
Workflow: implementing-an-epic step.
Subagents: tdd-implementer (Sonnet), then code-reviewer.
Gates: cargo check --manifest-path Cargo.toml · pnpm rust:clippy · cargo test -p openhuman notifications task_sources inbound · pnpm rust:layout
Activity
M3gA-Mind commentedon Nov 16, 2026
Re-checked on current main: not done yet. Each desktop notification is still triaged on its own (
desktop/notifications/rpc.rs), and there's nonotification:source on the event queues. Keeping this open as part of #8147.