Skip to content

fix(desktop): scale stranded-reply harvest window to the turn hard cap (partial #105247) - #107193

Closed
Finn763 wants to merge 1 commit into
NousResearch:mainfrom
Finn763:fix/105247-descr
Closed

Finn763 wants to merge 1 commit into
NousResearch:mainfrom
Finn763:fix/105247-descr

Conversation

@Finn763

@Finn763 Finn763 commented Sep 10, 2026

Copy link
Copy Markdown

What Problem This Solves

#105247 Issue 1: harvestStrandedUntilSettled (group-rounds.ts) polled every
5s for a fixed 60 tries = 5 minutes. A member turn that is visibly still
working legally runs up to GROUP_TURN_HARD_CAP_MS (20 min). If the room
stayed quiet after the base timeout (no new send, no fresh harvest pass), a
reply landing after minute 5 was never delivered.

Root Cause

The harvest bound was a magic number disconnected from the turn lifecycle it
protects. The cap owner (group-turns.ts) and the watcher (group-rounds.ts)
never shared the constant.

Changes

  • group-turns.ts: export GROUP_TURN_HARD_CAP_MS + new pure
    groupStrandedHarvestMaxTries(intervalMs) = max(60, ceil(hardCap/interval)
    • ceil(60s/interval)). At the production 5s interval: 252 tries (~21 min).
  • group-rounds.ts: use it instead of the hardcoded 60; doc comment updated.
  • group-harvest-bound.test.ts: 3 cases (covers cap+margin, old floor,
    interval scaling). Sabotage-verified (bound forced to 60 -> 2 red).

Evidence

  • New suite 3/3 green; full src/plugins/hermes-bots suite 64 files /
    587 tests green; tsc -p . --noEmit clean.

Scope

Partial: addresses the Issue 1 (harvest window) half of #105247. Issue 2
(silent member spawn/slot failures + retry + system notice) is not included:
no slot-busy error signature is observable from the desktop tree (zero hits
for slot/busy/pool-exhaustion strings in the plugin), so a transient-error
retry detector would be guesswork. Happy to follow up once the backend
error code is named.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) labels Sep 10, 2026
teknium1 added a commit that referenced this pull request Sep 15, 2026
Serialize room drives through their actual member completion, freeze input
watermarks by retained entry identity, and share the same completion path
with handoff continuations. Stop discards queued work without releasing an
active owner early; rename follows the existing room binding.

Observe stranded replies for the hard-cap duration plus grace after the
foreground wait, and retain unresolved failures in collapsed Activity.
Never automatically retry an ambiguous failed submit within the same drive.

Adapted from the queue and boundary approach in #92041 by @enwaiax and
harvest-budget approach in #107193 by @Finn763; #106502 by @wadib identified
failed-submit watermark consumption. The implementation retains current
numeric watermark storage, room lifecycle bindings and serial round limits.

Related: #92003, #105247, #100026
teknium1 added a commit that referenced this pull request Sep 15, 2026
Serialize room drives through their actual member completion, freeze input
watermarks by retained entry identity, and share the same completion path
with handoff continuations. Stop discards queued work without releasing an
active owner early; rename follows the existing room binding.

Observe stranded replies for the hard-cap duration plus grace after the
foreground wait, and retain unresolved failures in collapsed Activity.
Never automatically retry an ambiguous failed submit within the same drive.

Adapted from the queue and boundary approach in #92041 by @enwaiax and
harvest-budget approach in #107193 by @Finn763; #106502 by @wadib identified
failed-submit watermark consumption. The implementation retains current
numeric watermark storage, room lifecycle bindings and serial round limits.

Related: #92003, #105247, #100026
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks @Finn763. Your cap-derived harvest approach landed in #111283 at 9326d9c. Native Electron with real held inference and explicitly accelerated observation clocks reproduced the old 60-tick stop and verified the late reply arrives after the extended watch. Closing this harvest-only PR as superseded.

@teknium1 teknium1 closed this Sep 15, 2026
karljohannisson pushed a commit to karljohannisson/hermes-agent that referenced this pull request Sep 15, 2026
Serialize room drives through their actual member completion, freeze input
watermarks by retained entry identity, and share the same completion path
with handoff continuations. Stop discards queued work without releasing an
active owner early; rename follows the existing room binding.

Observe stranded replies for the hard-cap duration plus grace after the
foreground wait, and retain unresolved failures in collapsed Activity.
Never automatically retry an ambiguous failed submit within the same drive.

Adapted from the queue and boundary approach in NousResearch#92041 by @enwaiax and
harvest-budget approach in NousResearch#107193 by @Finn763; NousResearch#106502 by @wadib identified
failed-submit watermark consumption. The implementation retains current
numeric watermark storage, room lifecycle bindings and serial round limits.

Related: NousResearch#92003, NousResearch#105247, NousResearch#100026
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/*) 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.

3 participants