Skip to content

Epic: Reliable inbound events #8147

Open
3 of 17 issues completed
Open

Description

@senamakel

Milestone: Nov 9 - Nov 13 · Target: Dec 4 · Parent: tinyhumansai/team#42

This week (Nov 9 - Nov 13)

Status: Not started (0 of 17). Phase 0 shipped before the epic was filed.

Goal

Every inbound event reaches the agent through one durable, noise-tolerant pipeline: tinyeventqueues over the tinystoragedrivers QueueStore. That covers hosted channels, native channels, notifications, task sources, web chat, webhooks and Composio triggers.

  • Durable: nothing inbound is lost on a restart or under a burst.
  • Once: a platform redelivery never becomes a second turn.
  • Noise: it is gated, coalesced, habituated and batched before it costs a turn.
  • Visible: every drop has a reason you can see.

OpenHuman (the host) keeps:

  • the platform adapters that build the envelope;
  • the Deliver and ClassifySalience callbacks (triage and turns);
  • config, policy and the RPC/UI surface.

The pipeline itself lives in the module.

Where we are (deep dive, 2026-10-20)

Shipped (Phase 0):

Inbound path Today Loss / duplicate risk Leaf
Composio triggers queued (integrations/composio/bus/trigger_subscriber.rs:223-324) ambiguous-timeout double triage (inbound/route.rs:122-130) #8154
Agent webhooks queued (skills/webhooks/bus.rs:267-299) same #8154
Hosted channels (socket *:message) event bus → channels/bus/subscriber.rs, 180 s per turn, serial bus lag skips silently (SIGNAL_BUFFER = 256); no message id, no dedupe #8148
Native channels (TinyChannels module) mpsc::channel(100) (startup/start_channels.rs:164) lost on restart; platform acked before host persists (Telegram offset) senamakel/tinychannels#84, #8149
Desktop notifications direct triage (desktop/notifications/rpc.rs:112,187), 60 s content dedupe Deferred dropped (L217-231); one triage per notification #8150
Task sources direct triage (integrations/task_sources/route.rs:84,93) Deferred dropped #8150
Web chat start_chat (web_chat/ops/start_chat.rs:141), RunQueue in memory not durable; no client message id reaches the core #8151

What the module lacks before those migrations (tinyeventqueues origin/main df8d160):

Gap Evidence Leaf
Deliver is awaited inside the serialized pass; one long turn stalls every lane pipeline/dispatch.rs:133 senamakel/tinyeventqueues#1
after_dispatch vs after_turn acks are indistinguishable; no turn-completed signal pipeline/dispatch.rs:175-180 senamakel/tinyeventqueues#2
No per-source gate bypass or debounce override; web chat waits ~1.5 s SourcePolicy at tinyeventqueues-bus/src/config/types.rs:675-693 senamakel/tinyeventqueues#3
A host Urgent verdict doesn't skip a cadence; Turn has no salience; no notification:* policy pipeline/pass.rs:215-257,504 senamakel/tinyeventqueues#4
Stats has five totals only; context eviction and context on a dead-lettered turn are unrecorded tinyeventqueues-bus/src/outcome/types.rs:141-152 senamakel/tinyeventqueues#5

Host gap: inbound/deliver.rs:395-401 handles only trigger triage. Every other source is rejected (senamakel#514).

Target architecture

tinystoragedrivers  QueueStore port + drivers (memory, sqlite, file, mongodb, rabbitmq); queues.json
tinyeventqueues     the pipeline: ingress, gate, coalesce, salience, lanes, cadence, concurrent dispatch, DLQ;
                    pipeline.json defaults per source family; Stats by outcome/reason/source/lane
tinychannels        provider listeners that commit the platform cursor only after the host's DeliverInbound
openhuman           inbound/: envelope builders per source, a Deliver handler registry
                    (triage, agent turn, digest), ClassifySalience over triage, platform acks,
                    inbound.* RPCs and the settings panel; every adapter calls inbound::route,
                    its old path kept only as the direct fallback

Ground rules

  • The upstream PR in the owning repo lands and is released first. Then the gitlink bump and re-pin (scripts/modules/release-and-repin.mjs, pins from the published checksum.toml only), then the host change.
  • Each migration keeps its old path as the direct fallback used when [components] eventqueues or [inbound] enabled is off, or the module is unavailable. It is not a second live path.
  • No silent loss. Every event ends delivered, context, digest, dead or dropped-with-reason, and every drop publishes InboundEventDropped.
  • Every bug fix and every migration ships a failing-first regression test beside the code (*_tests.rs, never inline).
  • Contract types are never redeclared in OpenHuman (call through tinyeventqueues-bus). Wire names and RPC namespaces don't change. A new DomainEvent bumps EVENTS_VERSION.
  • CI and shipped builds use release module sources only. linked stays test-only.

Sub-issues

Phase 0: foundations (done)

Phase 1: module and contract changes (upstream, all parallel)

Phase 2: host foundation and hardening

Phase 3: migrations

Phase 4: tuning and visibility

Phase 5: definition of done

Suggested order

  1. Start now, in parallel: [inbound-queues] dispatch: deliver turns concurrently per lane instead of inside the pass senamakel/tinyeventqueues#1, [inbound-queues] contract: tag platform acks by policy and add a turn-completed signal senamakel/tinyeventqueues#2, [inbound-queues] sources: per-source gate bypass and debounce override for web chat senamakel/tinyeventqueues#3, [inbound-queues] salience: let an Urgent verdict skip a cadence; ship channel and notification policies senamakel/tinyeventqueues#4, [inbound-queues] stats: outcome counts by reason, source and lane; record lost context senamakel/tinyeventqueues#5, [inbound-queues] providers: commit the platform cursor only after the host persists senamakel/tinychannels#84, Refuse plaintext broker credentials in the RabbitMQ driver tinystoragedrivers#79, Event can be triaged twice when every queue ingest times out #8154 and Run the linked inbound e2e test in CI #8155. None depends on another. Batch the five module leaves into as few tinyeventqueues releases as is practical.
  2. [inbound-queues] inbound: Deliver handler registry for agent turns, digests and triage senamakel/openhuman#514 once [inbound-queues] dispatch: deliver turns concurrently per lane instead of inside the pass senamakel/tinyeventqueues#1 and [inbound-queues] contract: tag platform acks by policy and add a turn-completed signal senamakel/tinyeventqueues#2 are released. It unblocks every migration.
  3. Route hosted channel messages through the event queues #8148 (most lossy) and Batch desktop notifications and task sources through the event queues #8150 right after [inbound-queues] inbound: Deliver handler registry for agent turns, digests and triage senamakel/openhuman#514. Route native channel messages through the event queues #8149 once [inbound-queues] providers: commit the platform cursor only after the host persists senamakel/tinychannels#84 is released and the feat(channels): debounce and serialize inbound messages per conversation #8130 decision is made. Move web chat onto the event queues' interactive lane #8151 once [inbound-queues] sources: per-source gate bypass and debounce override for web chat senamakel/tinyeventqueues#3 is released, and last because of its latency risk.
  4. Classify borderline channel messages with ClassifySalience #8152 after the channel migrations; Show inbound queue stats and dead letters in settings #8153 after [inbound-queues] stats: outcome counts by reason, source and lane; record lost context senamakel/tinyeventqueues#5.
  5. Definition of done: [inbound-queues] e2e: no loss and no duplicate turns across restart and flood senamakel/openhuman#515. A restart test and a 10k-event flood across every source, on sqlite and RabbitMQ: no loss, no duplicate turns, and outcome counts that add up.

Decisions needed

Related

Sub-issues

Sub-issues

3 of 17 Issues completed
Loading 17 sub-issues

Activity

  1. added
    feature
    rust-core
    channels
    on Oct 20, 2026
  2. changed the title [-]Route all inbound events through the durable event queues[/-] [+]Epic: Route all inbound events through the durable event queues[/+] on Oct 20, 2026
  3. self-assigned this
    on Nov 9, 2026
  4. changed the title [-]Epic: Route all inbound events through the durable event queues[/-] [+]Epic: Reliable inbound events[/+] on Nov 9, 2026
  5. added
    priority: p2
    on Nov 9, 2026
  6. tinysweeper commented on Nov 9, 2026

    @tinysweeper

    Tracking epic for a durable, deduplicated inbound event pipeline (tinyeventqueues over QueueStore), with phased sub-issues across module, channels, storage and host repos. It is a coordination/planning artifact rather than a single bug or feature; the concrete work lives in the linked leaves. No candidate is the same underlying issue, so no duplicate is named.

    Labelled priority: p2.

  7. added theissue type on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

channelsfeaturepriority: p2rust-core

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions