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: an agent on a team machine reads its project's instructions (#2578)

0xken15a8b9933a740b
diff --git a/backend/src/lib/teamSession.test.ts b/backend/src/lib/teamSession.test.ts
index 2befb27cf..7b04faa71 100644
--- a/backend/src/lib/teamSession.test.ts
+++ b/backend/src/lib/teamSession.test.ts
@@ -174,6 +174,11 @@ describe('a team session on its own machine', () => {
['GET', '/api/super-tabs/tab-1/native/context-1', undefined, 'native.read'],
['POST', '/api/super-tabs/tab-1/native/context-1', { turnId: 't1', kind: 'prompt', previousEventId: null, text: 'hi', truncated: false, interrupted: false }, 'native.append'],
['GET', '/api/super-tabs/tab-1/projects/project-1/roles/dev', undefined, 'roleText'],
+ // The project's instructions, which its agents work by: the launch line runs `instructions`, and the host installs each
+ // revision as the agent's swarm-instructions skill (2026-11-02: a teammate's agent read neither, refused here).
+ ['GET', '/api/super-tabs/tab-1/projects/project-1/instructions?asAgentId=agent-1', undefined, 'instructions'],
+ ['GET', '/api/super-tabs/tab-1/projects/project-1/instructions/revisions?asAgentId=agent-1', undefined, 'instructionRevisions'],
+ ['GET', '/api/super-tabs/tab-1/projects/project-1/instructions/revisions/3?asAgentId=agent-1', undefined, 'instructionRevision'],
]
for (const [method, url, payload, reached] of own) {
it(`${method} ${url.split('?')[0]} reaches the store as the team session`, async () => {
@@ -256,7 +261,9 @@ describe('a team session reaching past its own machine', () => {
'/api/super-tabs/tab-1/route-decisions', '/api/super-tabs/tab-1/route-decisions/decision-1', '/api/super-tabs/tab-1/decisions?state=open',
'/api/super-tabs/tab-1/conversations/lead/messages', '/api/super-tabs/tab-1/conversations/lead/attempts',
'/api/super-tabs/tab-1/terminal/request-1', '/api/super-tabs/tab-1?asAgentId=', '/api/super-tabs/tab-1/parts',
- '/api/super-tabs/tab-1/changes?cursor=eyJ2IjoyfQ', '/api/super-tabs/tab-1/groups?dormant=1', '/api/super-tabs/tab-1/groups/group-1']) limited(await call('GET', url))
+ '/api/super-tabs/tab-1/changes?cursor=eyJ2IjoyfQ', '/api/super-tabs/tab-1/groups?dormant=1', '/api/super-tabs/tab-1/groups/group-1',
+ '/api/super-tabs/tab-1/projects/project-1/instructions', '/api/super-tabs/tab-1/projects/project-1/instructions/revisions',
+ '/api/super-tabs/tab-1/projects/project-1/instructions/revisions/3']) limited(await call('GET', url))
limited(await call('POST', '/api/super-tabs/tab-1/attachments'))
expect(store.calls).toEqual([])
})
diff --git a/backend/src/lib/teamSession.ts b/backend/src/lib/teamSession.ts
index adb59e504..12002a224 100644
--- a/backend/src/lib/teamSession.ts
+++ b/backend/src/lib/teamSession.ts
@@ -131,6 +131,12 @@ export const TEAM_ROUTES: readonly TeamRoute[] = [
{ method: 'GET', url: '/api/super-tabs/:tabId/routing-policy', scope: 'agent' },
{ method: 'GET', url: '/api/super-tabs/:tabId/route-decisions', scope: 'agent' },
{ method: 'GET', url: '/api/super-tabs/:tabId/route-decisions/:decisionId', scope: 'agent' },
+ // Its project's instructions, which every agent works by: its launch line runs `instructions`, and the host installs each
+ // revision as the agent's swarm-instructions skill (superTabs/instructions.ts). Missing here until 2026-11-02, so a
+ // teammate's agent worked by its role file alone.
+ { method: 'GET', url: '/api/super-tabs/:tabId/projects/:projectId/instructions', scope: 'agent' },
+ { method: 'GET', url: '/api/super-tabs/:tabId/projects/:projectId/instructions/revisions', scope: 'agent' },
+ { method: 'GET', url: '/api/super-tabs/:tabId/projects/:projectId/instructions/revisions/:revision', scope: 'agent' },
// The decisions its agent asked of people, and their answers (superTabs/decisions.ts).
{ method: 'GET', url: '/api/super-tabs/:tabId/decisions', scope: 'agent' },
{ method: 'GET', url: '/api/super-tabs/:tabId/conversations/:conversationId/messages', scope: 'agent' },