Commit 8b6de56
strip "Thought" prefix even when polish skipped
Operator-pasted chat 2026-05-18: "Hey there!" produced the answer
"Thought\n\nHello! How can I assist you today? 😊" -- the literal
"Thought" prefix leaked because:
* polish_can_skip returned True (short clean output, no narration)
* the skip path returned `raw_output` AS-IS without running
_strip_reasoning_leaks
* hermes uses qwen3.5:4b which is a reasoning-mode model that
emits "Thought\n\n<answer>" -- _LEADING_THOUGHT_RE was designed
to catch this but only ran on the polish output, not the skip
path
Fix: the skip-polish branch now runs _strip_outer_md_fence +
_strip_reasoning_leaks before returning the raw text. Same two
post-processors the polish branch already applies. Idempotent
on already-clean text.
Live verified end-to-end: input "Thought\n\nHello! How can I
assist?" -> output "Hello! How can I assist?" via the
skip-polish path. has_Thought_prefix=False.
Pipe re-installed into OWUI db; OWUI restarted clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 39b74de commit 8b6de56
1 file changed
Lines changed: 10 additions & 1 deletion
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
952 | | - | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
953 | 962 | | |
954 | 963 | | |
955 | 964 | | |
| |||
0 commit comments