Skip to content

The agent that grows with you

fix(desktop): a group member that is still working keeps its turn for up to three hours

teknium115ce7a553309
diff --git a/apps/desktop/src/plugins/hermes-bots/group-turns.test.ts b/apps/desktop/src/plugins/hermes-bots/group-turns.test.ts
index a3416ef768b..2bb3c91ad5d 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-turns.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-turns.test.ts
@@ -1160,6 +1160,28 @@ describe('in-flight marker', () => {
// still working; the next round harvests whatever landed instead of throwing
// the finished work away.
describe('stranded harvest', () => {
+ // #100274: the hard cap is a runaway guard, not a work budget. A member the
+ // gateway still reports busy keeps its turn well past the old 20-minute
+ // clamp; only a member that goes quiet expires on the idle timeout.
+ it('keeps a visibly working member past twenty minutes instead of stranding it', async () => {
+ // Every clock read jumps a minute (two reads per poll): twelve busy polls
+ // put the turn past 24 minutes while the member is still reporting work.
+ let now = 1_000_000
+ const clock = vi.spyOn(Date, 'now').mockImplementation(() => (now += 60_000))
+ const room = await loadRoom({ pollsBusy: 12, turn: () => 'long deploy done' })
+ const activity = await import('./group-activity')
+
+ try {
+ expect(await room.turns.runGroupChatMemberTurn('Room', LOCAL_MEMBER, 'deploy', 't1', [])).toBe(
+ 'long deploy done'
+ )
+ expect(room.chat.$groupChats.get().Room?.stranded?.helper).toBeUndefined()
+ expect(activity.$groupActivity.get().Room?.events.map(event => event.kind)).not.toContain('timed-out')
+ } finally {
+ clock.mockRestore()
+ }
+ })
+
const seedSession = (room: Room, stored: string, profile: string, title: string, messages: string[][]) => {
room.gateway.sessions.set(stored, {
messages: messages.map(([role, content]) => ({ content, role })),
diff --git a/apps/desktop/src/plugins/hermes-bots/group-turns.ts b/apps/desktop/src/plugins/hermes-bots/group-turns.ts
index abae5d23fae..c63d98a3462 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-turns.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-turns.ts
@@ -138,7 +138,7 @@ export function retainedGroupTurnError(state: GroupSessionSnapshot | null | unde
/** Is the member's session still doing work this turn should wait for?
* Reading a retained failure as busy kept a dead turn's deadline sliding to
- * the 20-minute hard cap and left its stranded marker harvestable forever
+ * the hard cap and left its stranded marker harvestable forever
* (#92760 silent stall, diagnosed in #95103). */
export function groupSessionBusy(state: GroupSessionSnapshot | null | undefined): boolean {
if (state?.running) {
@@ -498,8 +498,14 @@ async function submitGroupTurnPrompt(
// inflight/running) keeps its slot alive up to this hard cap. The base
// timeout alone silently dropped long real turns: a 7-minute research run
// timed out at 3 minutes, read as a pass, and its finished result never
-// reached the room (db's Aug 2026 report).
-export const GROUP_TURN_HARD_CAP_MS = 20 * 60000
+// reached the room (db's Aug 2026 report). The cap is a runaway guard, not a
+// budget: a member that stops reporting work still expires on the idle
+// timeout, so the cap only ever truncates a member that is demonstrably
+// producing. At 20 minutes it cut off 44% of the turns in a working
+// local-model room (#100274: mean 33 min, longest 154 min, none past 3 h) —
+// the downstream members were then handed a turn on work that did not exist
+// yet and the room settled while the worker was mid-deploy.
+export const GROUP_TURN_HARD_CAP_MS = 180 * 60000
/** Mirror a member's pending prompt — clarify question OR command approval —
* from its resume snapshot into the room store, keyed
diff --git a/website/docs/user-guide/bot-mode.md b/website/docs/user-guide/bot-mode.md
index 0982d6646e4..90a501ccc48 100644
--- a/website/docs/user-guide/bot-mode.md
+++ b/website/docs/user-guide/bot-mode.md
@@ -106,8 +106,10 @@ word sits next to its @mention (`stop @bot`, `@bot please pause`); the same word
elsewhere in the sentence is read as ordinary prose, so a German `halt` no longer
silences the bot it was sent to — but such a message does not release a held
member either (`@bot please just stop now` never wakes it; repeat the stop next
-to the mention to hold it). A quiet room watches timed-out members for another 21 minutes after the
-foreground wait ends; this observation window does not extend the turn itself.
+to the mention to hold it). A member that is visibly still working keeps its turn for up to three
+hours (a member that stops reporting work expires after three minutes of silence regardless); a quiet
+room then watches timed-out members for another three hours after the foreground wait ends, and this
+observation window does not extend the turn itself.
Unresolved member failures remain visible in the collapsed Activity summary after
the room settles — including a turn the member's backend itself failed (bad
credentials, provider errors), which is reported the moment the gateway