[PR #5738] [MERGED] fix: support Azure & Dell Pro AI Studio providers in agent summarization fallback #5546

Closed
opened 2026-06-05 15:21:42 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5738
Author: @sanidhyasin
Created: 6/1/2026
Status: Merged
Merged: 6/2/2026
Merged by: @timothycarambat

Base: masterHead: fix/agent-summarize-provider-support


📝 Commits (2)

  • 9c5ae16 fix: support Azure & Dell Pro AI Studio in agent summarization provider
  • 0cacf03 Merge branch 'master' into fix/agent-summarize-provider-support

📊 Changes

1 file changed (+20 additions, -0 deletions)

View changed files

📝 server/utils/agents/aibitat/providers/ai-provider.js (+20 -0)

📄 Description

Pull Request Type

  • 🐛 fix (Bug fix)

Relevant Issues

resolves #5353

Description

When an agent uses the web-scraping or document-summarizer skill and the
content exceeds the model's context window, the agent falls back to
summarizeContent(), which builds a LangChain chat model via
Provider.LangChainChatModel(provider, ...).

That switch statement was missing the azure and dpais (Dell Pro AI Studio)
cases, even though both are valid agent chat providers in
AIbitat.getProviderForConfig. As a result, workspaces whose agent provider is
Azure OpenAI or Dell Pro AI Studio crash during the summarization fallback with:

@agent: This page's content exceeds the model's context limit. Summarizing it right now.
@agent: Web Scraping Error: Unsupported provider "azure" for this task.

This adds the two missing cases using the same OpenAI-compatible base-URL
pattern these providers already use elsewhere in the codebase:

  • azureChatOpenAI with AzureOpenAiLLM.formatBaseUrl(AZURE_OPENAI_ENDPOINT) + AZURE_OPENAI_KEY
  • dpaisChatOpenAI with DellProAiStudioLLM.parseBasePath()

PR #5476 previously made the error message readable (it used to print
[object Object]); this PR removes the underlying crash for these providers so
summarization actually completes.

How to reproduce / validate

  1. Configure a workspace agent to use the Azure OpenAI (or Dell Pro AI Studio) provider.
  2. Ask the agent to scrape and summarize a page whose content exceeds the model context window (triggering the summarization fallback).
  3. Before: agent throws Unsupported provider ... for this task. After: the page is summarized normally.

Developer Validations

  • Diff is limited to the two added provider cases (+ their imports); all other lines are unchanged from master.
  • Verified formatting against the repo's prettier config and node --check for syntax.
  • I have not run the full backend test suite or live-tested against an Azure / dpais deployment (no credentials available in my environment). The added cases mirror the existing azure/dpais agent providers and the surrounding OpenAI-compatible cases.

Note: the two checkbox items above the line summarize what I did verify; happy to add a unit test for LangChainChatModel provider coverage if the team would like one (there is currently no test for this file).


🔄 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/5738 **Author:** [@sanidhyasin](https://github.com/sanidhyasin) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `fix/agent-summarize-provider-support` --- ### 📝 Commits (2) - [`9c5ae16`](https://github.com/Mintplex-Labs/anything-llm/commit/9c5ae16aec9b6f9856d1e97b4b2e1038521bebf1) fix: support Azure & Dell Pro AI Studio in agent summarization provider - [`0cacf03`](https://github.com/Mintplex-Labs/anything-llm/commit/0cacf03d33a0c1b45b6790f257a7aa1a6f663a34) Merge branch 'master' into fix/agent-summarize-provider-support ### 📊 Changes **1 file changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+20 -0) </details> ### 📄 Description ### Pull Request Type - [x] 🐛 fix (Bug fix) ### Relevant Issues resolves #5353 ### Description When an agent uses the `web-scraping` or `document-summarizer` skill and the content exceeds the model's context window, the agent falls back to `summarizeContent()`, which builds a LangChain chat model via `Provider.LangChainChatModel(provider, ...)`. That switch statement was missing the `azure` and `dpais` (Dell Pro AI Studio) cases, even though both are valid agent chat providers in `AIbitat.getProviderForConfig`. As a result, workspaces whose agent provider is Azure OpenAI or Dell Pro AI Studio crash during the summarization fallback with: ``` @agent: This page's content exceeds the model's context limit. Summarizing it right now. @agent: Web Scraping Error: Unsupported provider "azure" for this task. ``` This adds the two missing cases using the same OpenAI-compatible base-URL pattern these providers already use elsewhere in the codebase: - `azure` → `ChatOpenAI` with `AzureOpenAiLLM.formatBaseUrl(AZURE_OPENAI_ENDPOINT)` + `AZURE_OPENAI_KEY` - `dpais` → `ChatOpenAI` with `DellProAiStudioLLM.parseBasePath()` `PR #5476` previously made the error message readable (it used to print `[object Object]`); this PR removes the underlying crash for these providers so summarization actually completes. ### How to reproduce / validate 1. Configure a workspace agent to use the **Azure OpenAI** (or **Dell Pro AI Studio**) provider. 2. Ask the agent to scrape and summarize a page whose content exceeds the model context window (triggering the summarization fallback). 3. Before: agent throws `Unsupported provider ... for this task.` After: the page is summarized normally. ### Developer Validations - [x] Diff is limited to the two added provider cases (+ their imports); all other lines are unchanged from `master`. - [x] Verified formatting against the repo's prettier config and `node --check` for syntax. - [ ] I have not run the full backend test suite or live-tested against an Azure / dpais deployment (no credentials available in my environment). The added cases mirror the existing `azure`/`dpais` agent providers and the surrounding OpenAI-compatible cases. > Note: the two checkbox items above the line summarize what I did verify; happy to add a unit test for `LangChainChatModel` provider coverage if the team would like one (there is currently no test for this file). --- <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-06-05 15:21:42 -04:00
yindo closed this issue 2026-06-05 15:21:42 -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#5546