Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Swarm digest: a paused Swarm loads nothing for its digest on the Lead's poll (#1855)

0xken15b454a6240bc9
diff --git a/backend/integration/superTabLiveness.test.ts b/backend/integration/superTabLiveness.test.ts
index bcacc4e10..bb9e15c09 100644
--- a/backend/integration/superTabLiveness.test.ts
+++ b/backend/integration/superTabLiveness.test.ts
@@ -616,6 +616,29 @@ describe('the morning digest', () => {
expect(digest.text).not.toMatch(/Secret launch plan|Price it|Behind a flag/)
})
+ // Diego's issue file (2026-10-27): a paused Swarm sends no digest (digest.ts digestRequest), so it stays due, and every full
+ // Lead poll read the dormant groups and waiting decisions for it again, over a window that kept growing.
+ it('reads nothing for the digest while the Swarm is paused, and sends it once it resumes', async () => {
+ const queries: Array<{ model?: string; args: { where?: Record<string, unknown> } }> = []
+ const client = db.$extends({ query: { $allModels: { async $allOperations({ model, args, query }) {
+ queries.push({ model, args: args as { where?: Record<string, unknown> } })
+ return query(args)
+ } } } }) as unknown as PrismaClient
+ const f = await swarm({ client })
+ const projectId = (await f.timed.read(owner, f.tab)).state.projects![0]!.id
+ await f.execute({ type: 'project.digest', projectId, time: '03:00', timeZone: 'UTC' })
+ await f.execute({ type: 'tab.pause', paused: true })
+ f.clock.now = 3 * 60 * 60_000
+ queries.length = 0
+ await f.leadInbox()
+ const forDigest = queries.filter(q => (q.model === 'SwarmGroup' && q.args.where?.dormant === true && q.args.where.lastActivityAt) || q.model === 'SuperTabDecision')
+ expect(forDigest).toEqual([])
+ await f.execute({ type: 'tab.pause', paused: false })
+ f.clock.now += 30_000
+ await f.leadInbox()
+ expect((await db.superTabMessage.findMany({ where: { tabId: f.tab } })).filter(m => (m.source as { kind?: string } | null)?.kind === 'digest-request')).toHaveLength(1)
+ })
+
it('is sent once when two of the Lead\'s polls run at the same moment', async () => {
const f = await swarm()
const projectId = (await f.timed.read(owner, f.tab)).state.projects![0]!.id
diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.ts
index 82e554f37..4d1cb2314 100644
--- a/backend/src/superTabs/store.ts
+++ b/backend/src/superTabs/store.ts
@@ -1659,10 +1659,11 @@ export class SuperTabStore {
return transaction(this.db, async tx => {
let loaded = await this.load(tx, user, tabId)
// Work finished since the last digest and archived or asleep since still shipped, but ordinary loads leave it out
- // (#1757 review, 4): a due digest loads it.
+ // (#1757 review, 4): a due digest loads it. A paused Swarm sends none (digest.ts digestRequest), so its digest stays
+ // due: it loads nothing for it, or every poll repeats the loads over a growing window (Diego's issue file, 2026-10-27).
const led = ledProject(loaded.state, agentId)
let asked: Array<{ conversationId: string; personId: string; count: number }> = []
- if (led && digestDue(led, this.now())) {
+ if (led && !loaded.state.paused && digestDue(led, this.now())) {
const finished = await tx.swarmGroup.findMany({ where: { tabId, deleted: false, dormant: true, lastActivityAt: { gte: new Date(digestSince(led, this.now())) },
OR: [{ projectId: led.id }, ...led.id === 'lead' ? [{ projectId: null }] : []] }, select: { key: true } })
// A decision waits in its conversation even once that conversation went quiet.