Commit 39b74de
lazy-open <details> + "Hey there!" skip-refine (fix orphan-tag leak)
Operator-flagged 2026-05-18 chat: status emits ended at "🧠 → hermes"
and the raw stream below it showed the open <details type="reasoning"
data-mios-agent="hermes"> tag ORPHANED -- no close, no answer body.
Two root causes:
1. EAGER <details> open. The pipe yielded the open tag IMMEDIATELY
after dispatching to hermes, before any chunks arrived. If
hermes was cold-loading a model (30-90s) or returned empty, the
operator saw the open tag alone. The empty-output path had a
∅ emit but no close because POLISH_ENABLED gated whether the
close was emitted, and the close path only fired AFTER the
stream loop -- a hung stream never reached it.
Fix: LAZY-OPEN. The pipe tracks _details_opened state. The
<details> opener is emitted only on the FIRST chunk that
actually carries content (`text_piece` non-empty in delta).
Every close path (success, empty-output, timeout, exception)
now checks `_details_opened` -- emits the close only if a
matching open was emitted. Pure idempotent state machine; no
orphan tags possible.
2. "Hey there!" was inflating from 10c -> 111c through refine
because _CONVERSATIONAL_RE matched single greetings (`hi`,
`hello`, `hey`) but not greeting + neutral salutation
("hey there", "hi y'all", "hello everyone"). The cold model
load on this turn would have surfaced #1 anyway, but the
conversational gate should have short-circuited refine first
and gone straight to hermes for a one-line conversational
reply.
Fix: extend the leading-word alternation to bundle the salutation
form:
(hi|hello|hey|yo|howdy)(?:\s+(there|y'all|everyone|all|guys
|friend|friends|bot))?
Unit-tested 16/16: every greeting+salutation matches, every
non-greeting (e.g. "Hey there can you launch notepad", "Hello
world, list my apps") correctly DOES NOT match -- so multi-
intent prompts that lead with a greeting still go through
refine.
mios-owui-install-pipe re-ran; OWUI db function.content carries
both fixes. Live verified: pipe AST OK; 16/16 conversational-regex
tests pass in-container.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e5ac5bf commit 39b74de
1 file changed
Lines changed: 37 additions & 20 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| |||
1559 | 1565 | | |
1560 | 1566 | | |
1561 | 1567 | | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
1569 | 1581 | | |
1570 | 1582 | | |
1571 | 1583 | | |
| |||
1576 | 1588 | | |
1577 | 1589 | | |
1578 | 1590 | | |
1579 | | - | |
1580 | | - | |
| 1591 | + | |
1581 | 1592 | | |
1582 | 1593 | | |
1583 | 1594 | | |
| |||
1604 | 1615 | | |
1605 | 1616 | | |
1606 | 1617 | | |
1607 | | - | |
1608 | | - | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1609 | 1623 | | |
1610 | 1624 | | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
1614 | 1630 | | |
1615 | 1631 | | |
1616 | 1632 | | |
| |||
1646 | 1662 | | |
1647 | 1663 | | |
1648 | 1664 | | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
1652 | 1669 | | |
1653 | 1670 | | |
1654 | 1671 | | |
1655 | 1672 | | |
1656 | 1673 | | |
1657 | 1674 | | |
1658 | | - | |
| 1675 | + | |
1659 | 1676 | | |
1660 | 1677 | | |
1661 | 1678 | | |
| |||
0 commit comments