feat(teams): add text command parity - #1502
Draft
NeoHsu wants to merge 16 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Stacked draft: logical base
stack/teams-09-formatting-long-messagesis PR #1501. GitHub requires an upstream PR base to exist inopenabdev/openab, so this draft temporarily targetsmainand may show preceding stack layers. Do not merge it until #1501 is merged and this branch is rebased onto currentmain; then review only its single incremental commit.What problem does this solve?
Provide one platform-neutral Core command service for
/models,/agents,/cancel,/reset,/cancel-all, and/usage; give Teams safe text-commandparity through ordinary authenticated messages; preserve Discord native UX; and
publish a conservative manifest command menu without bypassing trust, privacy,
or negotiated delivery semantics.
Discord Discussion URL: https://discord.com/channels/1491295327620169908/1491365158868619404/1531339032527765655
Microsoft Teams roadmap discussion.
Review Contract
This is the proposed PR-body contract. It is not frozen until the owner or a
maintainer approves it and records the reviewed head plus an immutable contract
revision or hash.
Goal
Provide one platform-neutral Core command service for
/models,/agents,/cancel,/reset,/cancel-all, and/usage; give Teams safe text-commandparity through ordinary authenticated messages; preserve Discord native UX; and
publish a conservative manifest command menu without bypassing trust, privacy,
or negotiated delivery semantics.
Non-goals
/remind,/auth,/export,/new, arbitrary agent slash commands, Slacknative slash delivery, Adaptive Cards,
invokeactivities, message extensions,targeted messages, proactive messaging, cron, Graph, RSC, delegated tokens, new
permissions, a Gateway protocol bump, or a provider-general billing API are outside PR 10.
Accepted Residual Risks
Teams command responses are ordinary visible activities outside Personal chat;
therefore
/usageis denied rather than displayed on those surfaces. Aninstalled manifest does not update until an operator packages and installs a
new version. Old Core deployments retain the existing partial command set.
/resetand/cancel-allremain immediate destructive controls without a newconfirmation dialog, matching existing Discord behavior. Text config lists show
at most 25 entries even when the active backend exposes more; exact-name setting
still validates against the complete option set.
Acceptance Criteria
The six canonical commands share one semantic service; Teams executes them only
after structural, L2, L3, and authenticated mention handling; Discord native
interactions use the same semantics after their existing admission; recognized
commands never reach the agent or materialize attachments;
/usagecannot callthe backend or disclose data on a public or unproven-private surface;
/cancel-alland/resetclear every dispatcher lane in only the addressedlogical thread; Standalone command responses cannot deadlock the WebSocket
reader and obey negotiated send outcomes without retry; Unified and Standalone
are semantically equivalent; compatibility forms and old-peer behavior do not
regress; and the v1.25 manifest menu validates without targeted-message or new
permission fields.
Follow-ups
Evaluate Teams targeted/private messages under a separate trust and routing ADR;
add Adaptive Card interactions only after JWT/scope/identity admission is
specified for callbacks; consider a broader command registry if the core set
expands; evaluate provider-neutral usage reporting; add
/remind,/auth, and/exportas separately reviewed slices.At a Glance
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 channel command admission and platform-neutral command semantics.
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
Why this approach?
A shared semantic service prevents Teams and Discord command behavior from drifting while preserving each platform’s admission and UX.
Alternatives Considered
Implement a Teams-only command stack (rejected: semantic drift) or expose
/usagein groups (rejected: privacy risk).Validation
cargo check -p openab-corecargo check -p openab-gateway --features teamscargo test --manifest-path crates/platform-schema/Cargo.toml