Hi Ameer,
You're absolutely right about this - it's not a defect on your end. The 15-second timeout is actually a built-in limitation of the M365 Copilot platform that Microsoft hasn't made configurable yet.
Quick Solutions:
Optimize your LLM response time - Target under 12 seconds with a safety margin
// Add this timeout wrapper to your agent
Promise.race([yourLLMCall(), timeoutAfter(12000)])
Async processing pattern - Return immediate acknowledgment, then deliver the real response:
// Quick reply: "Processing your request..."
// Then send actual LLM response when ready
Performance tweaks:
- Add response caching
- Use streaming if your LLM supports it
- Deploy closer to Microsoft's servers
Best approach: Start with response time optimization since it gives the smoothest user experience. The async pattern works great as a backup for complex queries.
This is definitely a platform constraint we need to work around rather than a bug in your implementation. Your agent is working perfectly - we just need to dance within Microsoft's timing rules!
Thanks,
Karan Shewale.
*************************************************************************
If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.