fix(auto-search): strip all XML/HTML markup before embedding, not allowlist
extractUserPromptText previously enumerated specific tags to strip
(<instruction>, <ctx-search-hint>, <sidekick-augmentation>, OMO and
ALFONSO HTML comments). That missed real cases observed in production:
arbitrary <custom-tag>, future plugin markers we hadn't enumerated yet,
pasted code with <Component> markup, and HTML comments other than
temporal-awareness gap markers. Anything outside the allowlist reached
LMStudio/openai-compatible embedding endpoints as part of the query.
Replace the allowlist with a generic two-stage strip:
1. HTML comments: /<!--[\s\S]*?-->/g (covers temporal markers, OMO,
ALFONSO, plus anything else commented out).
2. Generic tag strip: /<\/?[a-zA-Z][^<>]*>/g (covers opening, closing,
and self-closing XML/HTML — both plugin-known and unknown).
system-reminder content remains dropped entirely by the existing
depth-aware parser because reminder content is plugin/host noise, never
user data. For ALL OTHER paired tags, the generic strip removes the
markup but preserves text BETWEEN paired tags as embedded content —
intentional: a user pasting <thing>important data</thing> still wants
"important data" in their embedding.
Updated the existing system-reminder test to reflect the new boundary
(<instruction> content survives, system-reminder content doesn't), and
added a dedicated test locking in the generic-strip behavior across
known tags, unknown tags, self-closing tags, and arbitrary comments. U
ualtinok committed
758deb09d4ef68c7144b5d748eeeecb15599b332
Parent: f56e500