fix: sanitize HTML error bodies from MCP servers to prevent web UI white screen (#263) - #656
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ilblackdragon
previously approved these changes
Mar 7, 2026
Contributor
Author
|
sorry, just try to fix the fix cargo fmt issue |
reidliu41
force-pushed
the
fix/263-mcp-html-error-body
branch
from
March 7, 2026 12:20
79b3ef6 to
10096e8
Compare
ilblackdragon
approved these changes
Mar 7, 2026
This was referenced Mar 7, 2026
Closed
Merged
bkutasi
pushed a commit
to bkutasi/ironclaw
that referenced
this pull request
Mar 28, 2026
…ite screen (nearai#263) (nearai#656) * fix: sanitize HTML error bodies from MCP servers to prevent web UI white screen (nearai#263) * style: fix cargo fmt formatting in sanitize_error_body tests
drchirag1991
pushed a commit
to drchirag1991/ironclaw
that referenced
this pull request
Apr 8, 2026
…ite screen (nearai#263) (nearai#656) * fix: sanitize HTML error bodies from MCP servers to prevent web UI white screen (nearai#263) * style: fix cargo fmt formatting in sanitize_error_body tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/mcp/client.rs) — strip HTML tags, collapse whitespace, truncate to 200 chars(char-boundary safe for multi-byte UTF-8)
llm/session.rs) via existingtruncate_for_previewrenderMarkdown()— escape text that starts with<!doctypeor<html>instead of rendering it as markupCloses #263
Test plan
uppercase
<HTML>variant, non-HTML angle brackets preservedcargo clippy --all --all-features— zero warningscargo test sanitize_error_body— 7/7 passed