Skip to content

fix(desktop,bots): render "(empty)" sentinel as a friendly message in group chat - #94310

Closed
RibatTRW wants to merge 1 commit into
NousResearch:mainfrom
RibatTRW:fix/desktop-group-chat-empty-sentinel
Closed

RibatTRW wants to merge 1 commit into
NousResearch:mainfrom
RibatTRW:fix/desktop-group-chat-empty-sentinel

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Aug 25, 2026 •

Copy link
Copy Markdown

Problem

A bot in the desktop Bot Mode group chat posts the raw "(empty)" when its turn produces no output. The gateway shows a friendly notice instead. The desktop bridge does not.

Fix

Normalize the sentinel at appendGroupChatEntry, matching the gateway text (gateway/run.py). "(pass)" silence and all other text are unchanged.

Tests

node --test apps/desktop/src/plugins/hermes-bots/tests/group-chat-empty-sentinel.test.mjs (2 pass). The test fails when the fix is reverted.

Fixes #94308

… group chat

The agent loop writes an internal "(empty)" sentinel when the
nudge/prefill/empties/fallback ladder all fail. The gateway converts it
into a user-friendly notice at delivery, but the desktop group-chat
bridge appended the raw sentinel into the room log (seen posting
"(empty)" in a Bot Mode group room), and it synced to the shared
ui_meta for mobile.

Normalize at the single choke point, appendGroupChatEntry, mirroring
gateway/run.py substitution so group chat and gateway surfaces show the
same text. (pass)/empty silence semantics unchanged. Includes a
regression test proven to fail on the pre-fix code.

Fixes NousResearch#94308
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Aug 25, 2026
@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference, author can ignore or act on any point.

Right fix shape, and the exact-trim equality faithfully mirrors the canonical matcher (agent/turn_finalizer.py compares _stripped == "(empty)", so no divergence there). Three points:

  1. The normalization hits user-authored entries too — apps/desktop/src/plugins/hermes-bots/plugin.js:6887: appendGroupChatEntry is also how "You" messages land in the room log (the test fixture itself shows { from: { kind: 'user', name: 'You' } } entries). A member who literally types (empty) into the room gets their message silently replaced by the ⚠️ model-failure text — wrong attribution and confusing in the opposite direction. Gate on the author kind (from.kind === 'member' / bot) so only machine replies are rewritten.

  2. Test-file hygiene — tests/group-chat-empty-sentinel.test.mjs:12-19 carries a TRACE_ATOM env-gated console.error debug scaffold inside the atom setter, and the harness drags in substantial machinery this file never uses (busyUntilResumeCall, conflictOnce conflict injection, clarify/approval payloads, session.create/resume/prompt.submit scripting). Two tests need maybe a tenth of it. Trim to what's exercised (or factor a shared harness module if one doesn't exist yet — three files now duplicate this loader nearly verbatim).

  3. Comment points at the wrong file — the docstring cites "gateway/run.py's user-friendly substitution", but the sentinel replacement lives in agent/turn_finalizer.py's completion explainer. Since the whole guarantee here is "match whatever the agent loop emits", name the authoritative site precisely (and its exact-comparison semantics) so a future widening there triggers someone to update this mirror.

@teknium1

Copy link
Copy Markdown
Collaborator

Merged via #96239 (rebase-merge) — your normalization fix is on main as-authored: a588685. Thanks @RibatTRW — you were the earliest submitter on the sentinel-protocol seam (00:08!), and your append-time rewrite of the exact (empty) sentinel to the gateway's friendly notice is the backstop half of the consolidated fix (landed together with #94386's selection half). Live-verified: the literal (empty) bubble on main renders as the friendly warning on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop Bot Mode group chat appends the raw "(empty)" sentinel as a bot message

4 participants