M365 Custom Engine Agents Timeout Message after 15 Seconds

Ameer 5 Reputation points
2025-06-27T18:07:07.7533333+00:00

Hi,

I used the M365 Agent Toolkit https://learn.microsoft.com/en-us/microsoft-365/developer/overview-m365-agents-toolkit to build a Custom Engine Agent that makes a call to my own LLM service. I was able to deploy and chat with my agents without a problem in MS Teams.

However, from https://copilot.microsoft.com, I am running into issues with the platform giving me a message to check again later. User's image

Upon refreshing the page after a few moments though, I always do see my actual LLM Service's response.

User's image

We noticed, it always does this at the 15 second mark.

How do I increase the timeout so that the Copilot UI never returns this message? Are there any other workarounds? Otherwise, this feels like a defect.

Thanks,

Ameer

Microsoft Copilot | Microsoft 365 Copilot | Development
{count} votes

1 answer

Sort by: Most helpful
  1. Karan Shewale 405 Reputation points Microsoft External Staff
    2025-07-01T08:10:48.59+00:00

    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. 


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.