Commit 848d50a
strip stacked <details> from polish + ban false-success reporting
Operator chat 2026-05-18: "open browser to youtube AND research
future tech" -> polished answer had:
* TWO stacked <details type="reasoning"> blocks (one the pipe
wrapped, one the polish model added on its own)
* Falsely reported both steps complete when only ONE tool call
(a failing web_extract) actually ran -- no mios-open-url, no
web_search
Two fixes:
1. _strip_reasoning_leaks now also strips <details>...</details>
blocks (new _DETAILS_BLOCK_RE, applied before the existing
<think>/<reasoning> strip). The pipe wraps agent thinking in
ITS OWN <details type="reasoning"> ABOVE the polished answer;
the polish model must NEVER emit its own. Unit-tested 6/6:
complete <details>, bare <details>, <details> with attributes,
stacked <details>+<think>, plus the regression case ("plain
answer no details").
2. Polish system prompt gains explicit rules:
* "NEVER emit <details> in your output. The pipe wraps agent
thinking in its own block above your answer. Adding another
one stacks them and the operator sees two expand-arrows."
* "NEVER report an action as 'successful' / 'completed' /
'opened' / 'launched' / 'posted' / 'sent' unless RAW OUTPUT
contains the matching tool_result with success:true. If a
planned step did not run or did not succeed, SAY SO -- 'Step
2 (web_search) did not run' or 'Step 1 (mios-open-url)
returned exit 1: <err>'."
Quotes the YouTube/web-search false-success as the case study.
mios-owui-install-pipe re-ran -> OWUI db function.content carries
the new polish prompt + strip logic. Live restart confirmed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f5db8f0 commit 848d50a
1 file changed
Lines changed: 30 additions & 3 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
569 | 582 | | |
570 | 583 | | |
571 | 584 | | |
| |||
855 | 868 | | |
856 | 869 | | |
857 | 870 | | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
858 | 881 | | |
859 | 882 | | |
860 | 883 | | |
| |||
872 | 895 | | |
873 | 896 | | |
874 | 897 | | |
875 | | - | |
876 | | - | |
877 | | - | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
878 | 905 | | |
879 | 906 | | |
880 | 907 | | |
| |||
0 commit comments