Skip to content

fix(desktop): mark the truncated head of a bot group-chat turn delta - #114352

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-114341
Closed

liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-114341

Conversation

@liuhao1024

Copy link
Copy Markdown

What does this PR do?

In a Bot Mode group chat, a member's turn prompt is rendered from only the last GROUP_CHAT_HISTORY_LIMIT (24) entries of its delta, but the successful-turn path advances the member's watermark past the entire turn tail. When more than 24 entries accumulate since a member's last turn, the head of the delta — typically the user's instruction that started the exchange — is never rendered, and because the watermark skips past it, it is never delivered on any later turn either. The drop is completely silent: the member cannot tell its view of the room is partial (#114341).

This PR makes the cut visible. When the delta exceeds the render window, the prompt's message list now opens with an explicit marker line:

… N earlier room messages omitted since your last turn

This is the smallest of the fix directions the issue proposes: it deliberately keeps the watermark semantics unchanged (not advancing past unrendered entries would let an over-long delta grow unboundedly and stall watermark progress) and keeps the limit fixed (a per-room configurable limit is a feature decision left to maintainers, see #98616).

Related Issue

Fixes #114341

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • apps/desktop/src/plugins/hermes-bots/group-round-prompt.ts: new formatGroupDeltaLines() helper that renders the last GROUP_CHAT_HISTORY_LIMIT delta lines and prepends an … N earlier room messages omitted since your last turn marker when entries were cut from the head.
  • apps/desktop/src/plugins/hermes-bots/group-round-members.ts: the member turn prompt (and, through the shared runGroupRoundMember entry, the continuation path) now builds its deltaLines via the helper instead of a bare slice(-GROUP_CHAT_HISTORY_LIMIT).
  • apps/desktop/src/plugins/hermes-bots/group-rounds.test.ts: two regression tests — the marker appears with the exact omitted count and the correct rendered window when the delta is over-long, and no marker when the delta fits.

How to Test

  1. cd apps/desktop && npx vitest run src/plugins/hermes-bots/group-rounds.test.ts
  2. Observed result: 60 passed (60), including the two new #114341 cases.
  3. Red check: with the two source files reverted and the tests kept, exactly the two new tests fail (2 failed | 58 passed), confirming they pin the marker behavior.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run the relevant test suite — this change is TypeScript-only, so the desktop suite instead of pytest: vitest run src/plugins/hermes-bots/group-rounds.test.ts → 60 passed; affected neighbours (group-chat, cross-connection-bots) → 111 passed; tsc -p . --noEmit clean; eslint and prettier --check clean on the changed files
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.6 (Apple Silicon)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A (behavior-preserving marker addition)
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — N/A (pure string rendering, no platform APIs)
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Not applicable — the change is in the turn prompt text, covered by the unit tests above.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Sep 17, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks @liuhao1024 — the work in this PR has landed on main via:

Your contribution is credited there (cherry-picked authorship / co-author trailer or credit in the PR body; see the linked PR for what was kept and what was trimmed). Closing this one as landed / superseded so the backlog reflects reality. If something in your original diff is still missing on current main, please comment and we'll reopen or follow up.

@teknium1 teknium1 closed this Sep 19, 2026
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 sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot Mode group chat: a member's turn silently drops the oldest part of its delta (GROUP_CHAT_HISTORY_LIMIT slice) while the watermark advances past it

3 participants