Added official hermes-gateway status messages (new comment category instead of tool calls and messages)
This commit is contained in:
1 parent
6f4bf3cb7f
commit
de3b5fd956
7 files changed
+327
-22
No files matched your search
@@ -560,6 +560,23 @@ def _is_tool_progress(content: str) -> bool:
|
||||
return _parse_tool_line(first) is not None
|
||||
|
||||
|
||||
def _is_gateway_lifecycle_notice(content: str) -> bool:
|
||||
"""True for hermes gateway lifecycle notices (restart / shutdown / online).
|
||||
|
||||
These are system notices, not tool progress. Their leading ⚠️/♻️ emoji
|
||||
would otherwise trip the tool-line heuristic and render them as a
|
||||
never-completing tool card (an endless spinner, since no ``tool.end``
|
||||
ever arrives for a notice that is not a real tool).
|
||||
"""
|
||||
if not content:
|
||||
return False
|
||||
c = content.strip()
|
||||
return any(
|
||||
marker in c
|
||||
for marker in ("Gateway restarting", "Gateway shutting down", "Gateway online")
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class _TurnState:
|
||||
"""Per-chat turn state for outbound frame classification (M2)."""
|
||||
@@ -1158,7 +1175,10 @@ class AndroidAdapter(BasePlatformAdapter):
|
||||
return SendResult(success=True, message_id=message_id)
|
||||
|
||||
# 4. Tool progress (first tool bubble of an editable line buffer).
|
||||
if _is_tool_progress(content):
|
||||
# Gateway lifecycle notices (restart/shutdown/online) are system
|
||||
# notices, not tool progress — skip the tool-line heuristic so they
|
||||
# fall through to commentary instead of a never-completing card.
|
||||
if not _is_gateway_lifecycle_notice(content) and _is_tool_progress(content):
|
||||
return await self._emit_tool_lines(chat_id, content, state, thread_id, is_edit=False)
|
||||
|
||||
# 5. Commentary (interim assistant beat).
|
||||
|
||||
Reference in new issue
Block a user