Skip to content

fix(group-chat): retry a member turn that fails transiently instead of consuming the mention - #114257

Open
wadib wants to merge 1 commit into
NousResearch:mainfrom
wadib:fix/group-chat-transient-turn-retry-v2
Open

wadib wants to merge 1 commit into
NousResearch:mainfrom
wadib:fix/group-chat-transient-turn-retry-v2

Conversation

@wadib

@wadib wadib commented Sep 17, 2026

Copy link
Copy Markdown

Problem

A member turn that throws a transient error of the 4001 session-reap class (e.g. a ws_orphan_reap the turn-level submit retry could not recover) was parked in the per-drive failedMembers set until the user's next action. The watermark stays unadvanced (the accepted-flag refactor), but the member is never re-driven — so a user's direct @mention goes unanswered and the room settles as if the member chose to pass. The bot goes silent on exactly the message that named it.

Fix

  • GroupRoundMemberContext.failedRetries: Map<string, number> — per-drive transient-failure counters.
  • runGroupRoundMember returns 'retry' for a 4001-class throw (isSessionGoneError) that still has retries left: watermark stays unadvanced, no entry appended, and the round loop runs another round so the re-drive happens before the room settles.
  • MAX_FAILED_TURN_RETRIES = 1 — after one re-drive the member is parked in failedMembers (skipped until the user acts again), so the room still settles against a genuinely-down member.
  • Ambiguous failure classes are NOT retried — they park immediately, keeping the "does not retry ambiguous member admission / ambiguous submit" contracts pinned in group-rounds.test.ts.
  • Timeouts (reply === null without a throw) keep their existing stranded-harvest path untouched.

Test

Adds group-rounds.stale-mention.repro.test.ts: the user @-mentions a member whose first TWO submits throw 4001-class errors (past the turn-level one-shot retry); the member still answers on the room-level re-drive. RED on base, GREEN with this change; full hermes-bots group suite 229/229, tsc clean, eslint clean.

Re-derivation of #106502 against the refactored round pipeline (that patch no longer applied).

…f consuming the mention

Re-derived from 227a500 against the refactored round pipeline. A thrown
member turn of the 4001 session-reap class (a ws_orphan_reap the turn-level
retry could not recover) was parked in failedMembers until the user's next
action, so a user's direct @mention went unanswered and the room settled as
if the member chose to pass. Now such a throw leaves the watermark
unadvanced and re-drives the member up to MAX_FAILED_TURN_RETRIES (1) before
parking; ambiguous failures keep parking immediately. Timeouts keep their
existing stranded-harvest path. Adds a RED-on-base regression test.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) comp/plugins Plugin system and bundled plugins labels Sep 17, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Related to closed, unmerged #106502: this re-derives its transient member-turn retry idea against the refactored group-round pipeline. It is also adjacent to #90933 and merged #111283, which address different delivery paths.

This branch has not been deployed

No deployments
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/*) comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants