fix(gmail): sanitize HTML entities and tags in tool output

Gmail API returns snippets with HTML entities (&amp;, &#39;, <br>, etc.)
that leaked into LLM responses as raw HTML. Added shared sanitizeHtml()
utility in src/utils/html.ts and applied it to gmail tool snippets,
HTML body fallback, and gmail watcher snippets.
This commit is contained in:
William Valentin
2026-02-10 16:30:14 -08:00
parent 4317492e4b
commit 4ce8e81c01
6 changed files with 281 additions and 4 deletions
+15
View File
@@ -947,6 +947,21 @@
"config/default.yaml"
]
},
"gmail-html-sanitization": {
"status": "completed",
"date": "2026-02-10",
"summary": "Sanitize HTML entities and tags in Gmail tool output. Gmail API returns snippets with HTML entities (&amp;, &#39;, <br>, etc.) that leaked into LLM responses. Added shared sanitizeHtml() utility and applied to both gmail tool and gmail watcher.",
"files_created": [
"src/utils/html.ts",
"src/utils/html.test.ts"
],
"files_modified": [
"src/tools/builtin/gmail.ts",
"src/tools/builtin/gmail.test.ts",
"src/automation/gmail.ts"
],
"test_status": "21/21 passing (html.test) + 18/18 passing (gmail.test) + 16/16 passing (automation/gmail.test)"
},
"tui-fullscreen-improvements": {
"status": "completed",
"date": "2026-02-10",