fix: update invalid inbound/outbound activities#340
fix: update invalid inbound/outbound activities#340rajan-chari wants to merge 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the outbound “sendable activity” typing surface in the Teams API package to better reflect what the Bot Framework /v3/conversations/{id}/activities endpoints accept, aligning the SDK’s type promises with runtime behavior (Fixes #338).
Changes:
- Narrow
ActivityParamsto only includeMessageActivityInput,TypingActivityInput, and (temporarily)MessageReactionActivityInput. - Remove several inbound-only
*ActivityInputtypes from the outboundActivityParamsunion to prevent users from attempting unsupported sends.
packages/api/src/microsoft_teams/api/activities/activity_params.py
Outdated
Show resolved
Hide resolved
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>
f150bd0 to
2b7b7f8
Compare
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>
Manual Test Results — Echo Bot (Python)Tested on branch
All 5 test steps from the test plan passed. The narrowed sendable union (message + typing only) works correctly; incoming event handlers are unaffected. |
|
I did another pass with Claude and based on scanning APX repo - it accepts message, command, and typing:
thus, Can you re-test different requests with these activities to verify acurracy? |
There was a problem hiding this comment.
Makes sense to me. @lilyydu based on your models work, I think you're better suited to approve.
Edit: saw your message above.
|
Why keep
When I tried it out, at least |
Summary
Fixes #338.
removed:
ConversationUpdateActivityInputinbound and outbound
HandoffActivitytype: "event"+name: "handoff.initiate"HandoffActionInvokeActivitywhich we haveinbound and outbound
TraceActivityMessageDeleteActivityInputMessageUpdateActivityInputCommandSendActivityInputCommandResultActivityInput