Hi @Akash Agarwal
Thank you for posting your question in the Microsoft Q&A forum.
Since I’m not a Python developer, I don’t want to accidentally give you misleading instructions. For the most accurate guidance, I’d recommend opening a new thread in the Microsoft Community Hub or on GitHub, there are many developers and SDK contributors there who can give you more targeted help.
Alternatively, I did some research that may help clarify what’s going on:
The structure task.type="continue" with an Adaptive Card contentType="application/vnd.microsoft.card.adaptive" is the correct format that Teams expects for a Task Module dialog.
However, the Agents SDK preview enforces typed models for invoke responses. If your handler returns a plain dictionary, the SDK’s serializer won’t accept it. When that happens, Teams falls back to the generic banner “Unable to reach app. Please try again.”
In the newer SDK builds, the expected response chain looks like this:
-TaskModuleResponse contains task and cache_info (required).
-TaskModuleContinueResponse wraps the TaskInfo value.
-CardTaskModuleTaskInfo (or equivalent) holds the Adaptive Card attachment
You must wrap the whole thing in an invokeResponse activity whose value is InvokeResponse.
If you want to double‑check the expected behavior, Microsoft’s documentation on Teams dialogs is helpful: Use dialogs in Microsoft Teams bots - Teams | Microsoft Learn.
Task Modules are supported in Teams when using the Python Agents SDK preview. The SDK’s dialog/activity handlers automatically map Teams invoke activities (task/fetch, task/submit) to your bot’s handler.
For a working reference implementation, you can look at the official sample: Microsoft-Teams-Samples/samples/bot-task-module/python at main · OfficeDev/Microsoft-Teams-Samples ….
I hope this information is helpful.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.