Repository navigation
Description
Parent: #8147
Summary
When every attempt to ingest an event into the queues times out, the event can be triaged twice: once by the caller's direct path and once by the queues if the ingest actually landed. Record the dedupe key on the direct path so the queued copy is recognized and skipped.
Steps to reproduce
- Make
Ingestslow enough thatinbound::routetimes out on every attempt, while the write still completes in the module. - Send one Composio trigger or webhook.
routereturnsDirect(crates/openhuman-core/src/inbound/route.rs), the caller triages it directly, and the module later delivers the stored copy too.
Expected
One triage / at most one turn for the event.
Actual
Two triages; the second is logged but not prevented.
Solution
On the ambiguous-timeout fallback, record the event's dedupe key (source:event_id) as completed (tombstone) before or alongside running the direct path, and have Deliver skip an envelope whose key is already completed.
Acceptance criteria
- Regression test — fails today: a timed-out-but-landed ingest produces two
apply_decisioncalls; passes with the fix: exactly one. - No new loss — an ingest that genuinely failed is still handled by the direct path.
- 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)
- Where it happens:
crates/openhuman-core/src/inbound/route.rs:122-130returnsOffered::Directafter three ambiguous attempts (deadlines 60 s, 10 s and 10 s at L54-58, with 500 ms pauses at L61). It warns "the queues may also deliver it". - Why the host can't catch the copy: the only host-side guard is an in-memory ring of 1,024
Acceptedturn ids (inbound/deliver.rs:60, 285-295). A direct-path triage never enters it, so the queued copy is not recognized.
Agent brief
Depends on: none · Blocks: none · Parallel with: senamakel#514, #8155
Research first
- Where to record the key so that it survives a restart: the queue's ingress tombstone (via a module member, which would be an upstream change) or a host document collection keyed
source:event_id.
Files to consider
- Read:
crates/openhuman-core/src/inbound/route.rs:40-163,inbound/deliver.rs:54-123,280-300 - Change:
inbound/route.rs,inbound/deliver.rs - Tests:
inbound/route_tests.rs,inbound/deliver_tests.rs
Workflow: implementing-an-epic step.
Subagents: systematic-debugger to reproduce the double triage, then tdd-implementer (Sonnet), then code-reviewer.
Gates: cargo check --manifest-path Cargo.toml · pnpm rust:clippy · cargo test -p openhuman inbound::route inbound::deliver
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
CodeGhost21 commentedon Nov 11, 2026
Picking this up: draft fix in #8667. The ambiguous-timeout fallback now claims the event (
source:event_id) for the direct path and records it in a host collection,inbound.direct, soDeliverskips the queued copy, after a restart too. If the queues deliver first while the offer is still retrying, the direct path is skipped instead.ci(inbound): isolate the new triage-once route tests with the staged …
docs(matrix): note the inbound triage-once behaviour on 10.3.5
fix(inbound): keep triage-once claims per workspace
fix(inbound): hold a direct-path claim until its triage ends
fix(inbound): close the remaining triage-once gaps from re-review
fix(inbound): triage an event once when every queue ingest times out