Skip to content

feat(teams): bound ingress routes and deduplicate activities - #1493

Draft
NeoHsu wants to merge 7 commits into
openabdev:mainfrom
NeoHsu:stack/teams-02-ingress-route-dedupe
Draft

feat(teams): bound ingress routes and deduplicate activities#1493
NeoHsu wants to merge 7 commits into
openabdev:mainfrom
NeoHsu:stack/teams-02-ingress-route-dedupe

Conversation

@NeoHsu

@NeoHsu NeoHsu commented Aug 20, 2026

Copy link
Copy Markdown

Important

Stacked draft: logical base stack/teams-01b-connector-transport is PR #1492. GitHub requires an upstream PR base to exist in openabdev/openab, so this draft temporarily targets main and may show preceding stack layers. Do not merge it until #1492 is merged and this branch is rebased onto current main; then review only its single incremental commit.

What problem does this solve?

Correlate authenticated inbound activities to later replies without cross-tenant collisions or duplicate publication.

Discord Discussion URL: https://discord.com/channels/1491295327620169908/1491365158868619404/1531339032527765655
Microsoft Teams roadmap discussion.

Review Contract

Goal

Correlate authenticated inbound activities to later replies without cross-tenant collisions or duplicate publication.

Non-goals

No restart persistence, proactive routing, write acknowledgement requirement, or durable activity ownership is added.

Accepted Residual Risks

Route and dedupe state is process-local and disappears on restart; capacity pressure can reject new work rather than evict in-flight publishers.

Acceptance Criteria

State is bounded and expires independently; duplicate waiters share one publication result; tenant/conversation collisions are impossible; failed enqueue rolls back provisional state; untrusted or malformed activities create no accepted route.

Follow-ups

Persist only trusted conversation-level routes in PR 11; activity ownership and dedupe remain intentionally ephemeral.

At a Glance

Authenticated Teams activity / operator target
                    │
                    ▼
            [this PR’s bounded layer]
                    │
                    ▼
          explicit outcome or fail-closed stop

Prior Art & Industry Research

OpenClaw: its Microsoft Teams extension separates access checks, Bot Framework route context, and outbound operations. For this slice the relevant comparison is trusted send context, scoped route state, and duplicate suppression.

Hermes Agent: its Teams platform adapter keeps Teams-specific transport and message shaping behind a platform adapter. It does not provide OpenAB’s negotiated Core/Gateway outcome contract, so this PR keeps the useful adapter boundary but adds explicit fail-closed semantics.

Proposed Solution

  • Add bounded, TTL-scoped Teams ingress routes and activity deduplication.
  • Scope route keys by app, tenant, conversation, and activity identity.
  • Roll back provisional state when local publication fails.

Why this approach?

Composite, bounded in-memory keys prevent cross-scope collisions while keeping activity-level state intentionally ephemeral.

Alternatives Considered

Key only by activity ID (rejected: cross-tenant collisions) or persist all activity state (rejected: unnecessary sensitive durability).

Validation

cargo check -p openab-gateway --features teams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant