[PR #5476] [MERGED] fix: surface readable error messages in web-scraping agent and ai-provider #5457

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5476
Author: @Akhil373
Created: 4/21/2026
Status: Merged
Merged: 4/21/2026
Merged by: @timothycarambat

Base: masterHead: fix/agent-error-serialization


📝 Commits (3)

  • fb13021 fix: surface readable error messages in web-scraping agent and ai-provider
  • 1272e12 simplify
  • 076006f Merge branch 'master' into fix/agent-error-serialization

📊 Changes

2 files changed (+7 additions, -4 deletions)

View changed files

📝 server/utils/agents/aibitat/plugins/web-scraping.js (+4 -3)
📝 server/utils/agents/aibitat/providers/ai-provider.js (+3 -1)

📄 Description

Pull Request Type

  • 🐛 fix (Bug fix)

Relevant Issues

connects #5353

Description

Instead of clear messages, error objects passed through template literals in the web-scraping handler and LangChainChatModel showed [object Object]. Fixed both to surface error.message or a JSON serialized fallback.

Visuals (if applicable)

Before:

Tool Call: web-scraping({"url":"https://example.com"})
@agent is executing `web-scraping` tool { "url": "https://example.com" }
@agent: Scraping the content of https://example.com
@agent: This page's content exceeds the model's context limit. Summarizing it right now.
@agent: Web Scraping Error: Unsupported provider [object Object] for this task.

After:
image

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • I have tested my code functionality

🔄 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/5476 **Author:** [@Akhil373](https://github.com/Akhil373) **Created:** 4/21/2026 **Status:** ✅ Merged **Merged:** 4/21/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `fix/agent-error-serialization` --- ### 📝 Commits (3) - [`fb13021`](https://github.com/Mintplex-Labs/anything-llm/commit/fb130211575aea1c469d40b5b1f91e04f3674e8a) fix: surface readable error messages in web-scraping agent and ai-provider - [`1272e12`](https://github.com/Mintplex-Labs/anything-llm/commit/1272e12443fe1b1a21f4e2e90f58840fb1b184b6) simplify - [`076006f`](https://github.com/Mintplex-Labs/anything-llm/commit/076006f49650c5ab3557a9dd863cde9e17b8f211) Merge branch 'master' into fix/agent-error-serialization ### 📊 Changes **2 files changed** (+7 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/agents/aibitat/plugins/web-scraping.js` (+4 -3) 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+3 -1) </details> ### 📄 Description ### Pull Request Type - [x] 🐛 fix (Bug fix) ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> connects #5353 ### Description Instead of clear messages, error objects passed through template literals in the web-scraping handler and LangChainChatModel showed [object Object]. Fixed both to surface `error.message` or a JSON serialized fallback. ### Visuals (if applicable) <!-- Add screenshots or screen recordings to demonstrate the changes, especially for UI updates. --> Before: ``` Tool Call: web-scraping({"url":"https://example.com"}) @agent is executing `web-scraping` tool { "url": "https://example.com" } @agent: Scraping the content of https://example.com @agent: This page's content exceeds the model's context limit. Summarizing it right now. @agent: Web Scraping Error: Unsupported provider [object Object] for this task. ``` After: <img width="788" height="434" alt="image" src="https://github.com/user-attachments/assets/5ceff6e6-9a13-4493-afa6-a95cb5b5ce3d" /> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] I have tested my code functionality --- <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:25 -04:00
yindo closed this issue 2026-06-05 15:21:25 -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#5457