[PR #20749] [CLOSED] fix: Decode HTML entities in tool call results before sending to LLM #41392

Closed
opened 2026-04-25 13:38:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20749
Author: @YuriNachos
Created: 1/17/2026
Status: Closed

Base: devHead: fix-20600-html-entities-decode


📝 Commits (1)

  • 666be80 fix: Decode HTML entities in tool call results before sending to LLM

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 src/lib/utils/index.ts (+2 -1)

📄 Description

Description

  • Fixes #20600 - HTML entities in tool call results not decoded before sending to LLM

Added

  • N/A

Changed

  • Applied unescapeHtml() function to decode HTML entities in tool call results before inserting into messages

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • Tool call results: Fixed HTML entities like ", &, ' not being decoded before sending to LLM
  • Previously, tool results were stored with HTML-escaped content and retrieved from DB with entities still present
  • Now processDetails() properly decodes HTML entities before inserting tool call results into messages
  • This ensures the LLM receives clean JSON instead of malformed escaped entities

Security

  • N/A

Breaking Changes

  • N/A

Additional Information

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/open-webui/open-webui/pull/20749 **Author:** [@YuriNachos](https://github.com/YuriNachos) **Created:** 1/17/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix-20600-html-entities-decode` --- ### 📝 Commits (1) - [`666be80`](https://github.com/open-webui/open-webui/commit/666be80719485279f26b6f80bcc6b9d86deef6b7) fix: Decode HTML entities in tool call results before sending to LLM ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/utils/index.ts` (+2 -1) </details> ### 📄 Description ### Description - Fixes #20600 - HTML entities in tool call results not decoded before sending to LLM ### Added - N/A ### Changed - Applied `unescapeHtml()` function to decode HTML entities in tool call results before inserting into messages ### Deprecated - N/A ### Removed - N/A ### Fixed - **Tool call results**: Fixed HTML entities like `&quot;`, `&amp;`, `&#x27;` not being decoded before sending to LLM - Previously, tool results were stored with HTML-escaped content and retrieved from DB with entities still present - Now `processDetails()` properly decodes HTML entities before inserting tool call results into messages - This ensures the LLM receives clean JSON instead of malformed escaped entities ### Security - N/A ### Breaking Changes - N/A --- ### Additional Information - Issue: #20600 - Affects multi-turn conversations with tool calls - Improves LLM performance by providing clean, properly formatted JSON ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 13:38:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#41392