[PR #4824] [CLOSED] Add cooldown option for MCP servers #4783

Closed
opened 2026-02-22 18:36:31 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4824
Author: @shatfield4
Created: 1/5/2026
Status: Closed

Base: masterHead: 4817-feat-set-cooldown-per-mcp-server


📝 Commits (5)

  • 21b6d94 add cooldown option for MCP servers that use deduplicator
  • 094d667 wip mcp cooldown for providers not using untooled
  • ee3fa67 add tests for cooldown and jsdoc for cooldown functions
  • d5322a5 patch providers to exit agentic loop on duplicate tool call
  • a3f838e handle 0 cooldown in dedupe + fix anthropic dedupe message structure

📊 Changes

11 files changed (+567 additions, -95 deletions)

View changed files

server/__tests__/utils/agents/aibitat/providers/cooldown.test.js (+243 -0)
📝 server/utils/MCP/index.js (+6 -0)
📝 server/utils/agents/aibitat/providers/ai-provider.js (+39 -0)
📝 server/utils/agents/aibitat/providers/anthropic.js (+109 -26)
📝 server/utils/agents/aibitat/providers/azure.js (+28 -7)
📝 server/utils/agents/aibitat/providers/cohere.js (+1 -0)
📝 server/utils/agents/aibitat/providers/gemini.js (+65 -16)
📝 server/utils/agents/aibitat/providers/helpers/untooled.js (+5 -26)
📝 server/utils/agents/aibitat/providers/ollama.js (+2 -0)
📝 server/utils/agents/aibitat/providers/openai.js (+66 -18)
📝 server/utils/agents/aibitat/utils/dedupe.js (+3 -2)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4817

What is in this change?

Additional Information

Handles Duplicate Calls:

  • OpenAI
  • Anthropic
  • Gemini
  • Cohere
  • Azure

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4824 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 1/5/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `4817-feat-set-cooldown-per-mcp-server` --- ### 📝 Commits (5) - [`21b6d94`](https://github.com/Mintplex-Labs/anything-llm/commit/21b6d942711b305cd218e2fc69fc76feba6e9193) add cooldown option for MCP servers that use deduplicator - [`094d667`](https://github.com/Mintplex-Labs/anything-llm/commit/094d667b81829dd2a093ebc958988419833b2675) wip mcp cooldown for providers not using untooled - [`ee3fa67`](https://github.com/Mintplex-Labs/anything-llm/commit/ee3fa6749035841311c9e3cb1674ee3deb5e93ee) add tests for cooldown and jsdoc for cooldown functions - [`d5322a5`](https://github.com/Mintplex-Labs/anything-llm/commit/d5322a5b37b12997665e881457ab5aa7f0df7218) patch providers to exit agentic loop on duplicate tool call - [`a3f838e`](https://github.com/Mintplex-Labs/anything-llm/commit/a3f838eb431e4668807f04f86d07204a236d892c) handle 0 cooldown in dedupe + fix anthropic dedupe message structure ### 📊 Changes **11 files changed** (+567 additions, -95 deletions) <details> <summary>View changed files</summary> ➕ `server/__tests__/utils/agents/aibitat/providers/cooldown.test.js` (+243 -0) 📝 `server/utils/MCP/index.js` (+6 -0) 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+39 -0) 📝 `server/utils/agents/aibitat/providers/anthropic.js` (+109 -26) 📝 `server/utils/agents/aibitat/providers/azure.js` (+28 -7) 📝 `server/utils/agents/aibitat/providers/cohere.js` (+1 -0) 📝 `server/utils/agents/aibitat/providers/gemini.js` (+65 -16) 📝 `server/utils/agents/aibitat/providers/helpers/untooled.js` (+5 -26) 📝 `server/utils/agents/aibitat/providers/ollama.js` (+2 -0) 📝 `server/utils/agents/aibitat/providers/openai.js` (+66 -18) 📝 `server/utils/agents/aibitat/utils/dedupe.js` (+3 -2) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4817 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> ### Additional Information Handles Duplicate Calls: - [x] OpenAI - [x] Anthropic - [ ] Gemini - [ ] Cohere - [ ] Azure <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [ ] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated - [ ] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:31 -05:00
yindo closed this issue 2026-02-22 18:36:31 -05:00
yindo changed title from [PR #4824] Add cooldown option for MCP servers to [PR #4824] [CLOSED] Add cooldown option for MCP servers 2026-06-05 15:20:21 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4783