feat: add ctx.delete(activity_id) convenience method#343
Draft
rajan-chari wants to merge 9 commits intomainfrom
Draft
feat: add ctx.delete(activity_id) convenience method#343rajan-chari wants to merge 9 commits intomainfrom
rajan-chari wants to merge 9 commits intomainfrom
Conversation
The ActivityParams union included 10 *ActivityInput types, but the Teams service (APX) only accepts `message` and `typing` on outbound POST/PUT. The other types (messageDelete, messageUpdate, conversationUpdate, handoff, trace, commandSend, commandResult) are inbound-only event notifications — sending them produces gateway errors. Narrowing the union to MessageActivityInput, TypingActivityInput, and MessageReactionActivityInput (kept temporarily — needs its own send path via the reactions API) so the type system matches what actually works at runtime. The *ActivityInput classes themselves are preserved for model symmetry; only the union membership changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrite header comment to explain the union's purpose without internal terminology. Explicitly call out MessageReactionActivityInput as a temporary inclusion pending its own send path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete 7 *ActivityInput classes that were removed from the ActivityParams union in the previous commit and have zero references: - MessageDeleteActivityInput - MessageUpdateActivityInput - ConversationUpdateActivityInput - HandoffActivityInput - TraceActivityInput - CommandSendActivityInput - CommandResultActivityInput These represented inbound-only event types (server→bot) and had no valid outbound send path. The corresponding *Activity classes (used as handler type hints) are preserved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the outbound activity union type to better communicate its purpose. ActivityParams was vague — SendableActivity makes the API self-documenting: `async def send(self, activity: SendableActivity)`. Also renames the module file activity_params.py → sendable_activity.py. 13 files changed, pure rename — no logic changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds delete() to ActivityContext and ActivitySender so handlers can delete activities without reaching through the raw API client: await ctx.delete(activity_id) instead of: await ctx.api.conversations.activities(conv_id).delete(activity_id) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lilyydu
reviewed
Apr 1, 2026
packages/apps/src/microsoft_teams/apps/routing/activity_context.py
Outdated
Show resolved
Hide resolved
packages/apps/src/microsoft_teams/apps/routing/activity_context.py
Outdated
Show resolved
Hide resolved
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.
Summary
Stacked on #340 → #341 → #342. Adds a
delete()convenience method toActivityContextandActivitySender.Before:
After:
Why
With
MessageDeleteActivityInputremoved fromSendableActivity, there's no way to delete viactx.send()(which was broken anyway). This provides an ergonomic alternative to reaching through the raw API client. Opening as draft since the existing verbose path works fine — this is a convenience, not a fix.Test plan
ctx.delete(sent.id)in a handler → activity is removed from conversation🤖 Generated with Claude Code