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.

fix(super-tabs): an assigned worker's post reaches its Lead (#1529)

Jacob Pham8c2624ccca85
diff --git a/backend/src/superTabs/commands.test.ts b/backend/src/superTabs/commands.test.ts
index 126e67ea1..6ee587a0a 100644
--- a/backend/src/superTabs/commands.test.ts
+++ b/backend/src/superTabs/commands.test.ts
@@ -96,6 +96,23 @@ describe('Super Tab collaboration policy', () => {
{ reply: { id: posted.id, conversationId: 'elsewhere', author: posted.author } })).toThrow('Reply to a message in this conversation')
})
+ it('delivers an assigned worker\'s own post to its Lead, and nobody else\'s', () => {
+ const f = fixture()
+ const lead = f.add('lead', 'owner', 'lead', true)
+ const group = f.group(), worker = f.add('worker', 'owner', group), other = f.add('other', 'owner', group)
+ const as = (agentId: string): Actor => ({ kind: 'agent', agentId, machineOwnerId: 'host-owner' })
+ const post = (actor: Actor, recipientIds: string[] = []) => f.run({ type: 'message.send', conversationId: group, text: 'PR is green.',
+ replyTo: null, recipientIds }, actor).messages[0]!.recipients
+ expect(post(as(worker))).toEqual([])
+ f.run({ type: 'work.assign', conversationId: group, agentId: worker })
+ expect(post(as(worker))).toEqual([lead])
+ expect(post(as(worker), [other])).toEqual([other])
+ expect(post(as(other))).toEqual([])
+ expect(post(as(lead))).toEqual([])
+ f.run({ type: 'work.status', conversationId: group, assignmentId: f.state.conversations[1]!.assignment!.id, status: 'blocked', result: 'Stuck.' }, as(worker))
+ expect(post(as(worker))).toEqual([lead])
+ })
+
it('lets a viewer read and leave, but not send, assign, attach or invite', () => {
const f = fixture()
f.invite('viewer')
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.ts
index fc4a6c78a..8f1a9f8af 100644
--- a/backend/src/superTabs/commands.ts
+++ b/backend/src/superTabs/commands.ts
@@ -563,7 +563,12 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
fail('INVALID_REPLY', 'Reply to a message in this conversation.', 400)
}
const replyAgent = context.reply?.author.kind === 'agent' ? context.reply.author.id : null
- const automatic = actor.kind === 'person' ? (replyAgent && group.agentIds.includes(replyAgent) ? replyAgent : group.leadId) : null
+ // An assigned worker's own post in its group reaches the Lead. Workers reported results as plain posts, which went to no
+ // one: the Lead heard only at the next scheduled consolidation, and the owner saw no summary of finished work for up to
+ // 19 minutes (2026-10-21/22). Only the worker's posts are routed, never the Lead's back, so agents cannot loop.
+ const worker = actor.kind === 'agent' && activeWork(group) && group.assignment?.agentId === actor.agentId
+ && group.leadId && group.leadId !== actor.agentId && group.agentIds.includes(group.leadId) ? group.leadId : null
+ const automatic = actor.kind === 'person' ? (replyAgent && group.agentIds.includes(replyAgent) ? replyAgent : group.leadId) : worker
const recipients = [...new Set(command.recipientIds.length ? command.recipientIds : automatic ? [automatic] : [])]
for (const id of recipients) {
agent(state, id)