spring-projects / spring-projects/spring-ai
Occasionally, the mcp tool invoked by springai reports this error:Did not observe any item or terminal signal within 20000ms in 'Mono.deferContextual ⇢ at io.modelcontextprotocol.spec.McpClientSession.sendRequest(McpClientSession.java:233)'
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Bug description
I am using the Playwright MCP tool, and this unexpected error occurs occasionally. I'm not sure if it's a bug in the underlying Spring AI or if the tool has timed out in response
If the tool response times out, how should we correctly set the timeout period
Environment
spring ai 1.0,0
org.springframework.ai
spring-ai-starter-model-deepseek
Prompt prompt = new Prompt(getMessageList(), this.chatOptions);
ToolExecutionResult toolExecutionResult = toolCallingManager.executeToolCalls(prompt, toolCallChatResponse);
Steps to reproduce
This abnormal error occurs sporadically and cannot be reproduced
Minimal Complete Reproducible example
java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 20000ms in 'Mono.deferContextual ⇢ at io.modelcontextprotocol.spec.McpClientSession.sendRequest(McpClientSession.java:233)' (and no fallback has been configured)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with io.modelcontextprotocol.spec.McpClientSession.sendRequest at line 233 and the toolExecutionManager.executeToolCalls call shown in the report. Determine whether the 20-second timeout originates in Spring AI or the MCP tool, then identify the supported timeout configuration. Done means the timeout behavior or configuration is clarified and covered by a reproducible test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- ai, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100