Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: support up to twelve concurrent claim swarm agents
[._.]/ Adam Eivy478ed9612369
diff --git a/client/src/components/cos/constants.js b/client/src/components/cos/constants.jsindex 51615efa1a..c11ca2cc99 100644--- a/client/src/components/cos/constants.js+++ b/client/src/components/cos/constants.js@@ -405,19 +405,16 @@ export const ISSUE_AUTHOR_FILTER_OPTIONS = [// issue-claiming task type here rather than OR-ing literals across components.export const ISSUE_AUTHOR_FILTER_TASK_TYPES = new Set(['claim-issue', 'claim-work']);-// Swarm fan-out (taskMetadata.swarmCount). Mirrors slashdo `/do:next --swarm=<N>`-// (clamped 1..6; bare --swarm = 3). 0 = off (single issue per run, the default);-// 2..6 = claim & ship that many independent issues in parallel. Server-side-// SWARM_COUNT_MIN/MAX (cosValidation.js) enforce the same 2..6 range. Exposed on-// the same forge-issue task types as the author filter.+// Scheduled claim swarm fan-out (taskMetadata.swarmCount). 0 = off;+// 2..12 = parallel workers, matching SWARM_COUNT_MIN/MAX in cosValidation.js.+// Exposed on the same forge-issue task types as the author filter.export const SWARM_TASK_TYPES = ISSUE_AUTHOR_FILTER_TASK_TYPES;export const SWARM_COUNT_OPTIONS = [{ value: 0, label: 'Off (one issue per run)', description: 'Claim and ship a single issue per scheduled run (default)' },- { value: 2, label: '2 in parallel', description: 'Claim and ship up to 2 independent issues per run, merges serialized' },- { value: 3, label: '3 in parallel', description: 'Claim and ship up to 3 independent issues per run, merges serialized' },- { value: 4, label: '4 in parallel', description: 'Claim and ship up to 4 independent issues per run, merges serialized' },- { value: 5, label: '5 in parallel', description: 'Claim and ship up to 5 independent issues per run, merges serialized' },- { value: 6, label: '6 in parallel', description: 'Claim and ship up to 6 independent issues per run, merges serialized' }+ ...Array.from({ length: 11 }, (_, index) => {+ const value = index + 2;+ return { value, label: `${value} in parallel`, description: `Claim and ship up to ${value} independent issues per run, merges serialized` };+ })];// branch-reconcile coordinator batch size (taskMetadata.branchesPerAgent).diff --git a/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx b/client/src/components/cos/tabs/schedule/AppOverrideRow.jsxindex 89759d0606..393ba45bd4 100644--- a/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx+++ b/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx@@ -89,7 +89,7 @@ const AppOverrideRow = memo(function AppOverrideRow({ app, taskType, globalInter// Swarm count goes as a Number: the server's sanitizer KEEPS an explicit 0// (how a per-app override turns swarm off even when the global default has it- // on) and 2..6; only 1 / out-of-range / non-integer are dropped. Inherit is+ // on) and 2..12; only 1 / out-of-range / non-integer are dropped. Inherit is// the absent key, distinct from a stored 0.const handleSwarmCountChange = (raw) => handleOverrideChange('swarmCount', raw === '' ? '' : Number(raw));const handleBranchesPerAgentChange = (raw) => handleOverrideChange('branchesPerAgent', raw === '' ? '' : Number(raw));diff --git a/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx b/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsxindex 272f761b77..09e3522af7 100644--- a/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx+++ b/client/src/components/cos/tabs/schedule/AppOverrideRow.test.jsx@@ -312,3 +312,10 @@ it('allows an app to override the claim PR handoff policy', async () => {await act(async () => { fireEvent.change(prSelect(), { target: { value: 'review-then-merge' } }); });expect(onUpdate).toHaveBeenCalledWith(APP.id, 'claim-issue', expect.objectContaining({ taskMetadata: { prCompletion: 'review-then-merge' } }));});++it('inherits a twelve-worker swarm and saves an explicit per-app count', async () => {+ const onUpdate = renderRow({ taskType: 'claim-issue', globalTaskMetadata: { swarmCount: 12 } });+ expect(screen.getByRole('option', { name: 'Inherit (12 in parallel)' })).toBeInTheDocument();+ await act(async () => fireEvent.change(screen.getByLabelText('Swarm mode for Acme'), { target: { value: '12' } }));+ expect(onUpdate).toHaveBeenCalledWith('app-1', 'claim-issue', { taskMetadata: { swarmCount: 12 } });+});diff --git a/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx b/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsxindex 7ede692235..2386992859 100644--- a/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx+++ b/client/src/components/cos/tabs/schedule/GlobalConfigControls.jsx@@ -167,7 +167,7 @@ export default function GlobalConfigControls({ taskType, config, onUpdate, onTriconst handleSwarmCountChange = async (value) => {setUpdating(true);- // 0 = off, 2..6 = swarm size (server keeps both; 1/out-of-range are dropped).+ // 0 = off, 2..12 = swarm size (server keeps both; 1/out-of-range are dropped).// taskMetadata is replaced wholesale server-side, so spread the existing keys.await onUpdate(taskType, {taskMetadata: { ...(config.taskMetadata || {}), swarmCount: value }diff --git a/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx b/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsxindex bfe18daffb..a7271f5b2a 100644--- a/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx+++ b/client/src/components/cos/tabs/schedule/GlobalConfigControls.test.jsx@@ -425,3 +425,11 @@ it('hides the reviewer picker when claim-issue is configured with merge-on-greenrenderControls({ taskType: 'claim-issue', taskMetadata: { useWorktree: false, openPR: false, claimFlow: true, prCompletion: 'merge-on-green' } });expect(screen.queryByTestId('reviewer-picker')).not.toBeInTheDocument();});++it('offers and saves twelve parallel claim workers without dropping other metadata', async () => {+ const onUpdate = renderControls({ taskType: 'claim-issue', taskMetadata: { simplify: true } });+ const select = screen.getByLabelText('Swarm Mode');+ expect([...select.options].map(option => Number(option.value))).toEqual([0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);+ await act(async () => fireEvent.change(select, { target: { value: '12' } }));+ expect(onUpdate).toHaveBeenCalledWith('claim-issue', { taskMetadata: { simplify: true, swarmCount: 12 } });+});diff --git a/server/lib/cosValidation.js b/server/lib/cosValidation.jsindex 8380218d78..ff0c81f1cb 100644--- a/server/lib/cosValidation.js+++ b/server/lib/cosValidation.js@@ -1050,15 +1050,14 @@ export function normalizeIssueExcludeLabels(list) {return out;}-// claim-issue `--swarm` fan-out size. Mirrors slashdo `/do:next --swarm=<N>`,-// which clamps N to 1..6 and treats bare `--swarm` as 3. Here a swarmCount of+// Scheduled claim-issue swarm fan-out size. A swarmCount of// 0 (or absent) means swarm OFF (the default one-issue-per-run flow); a value-// of 2..6 turns on swarm with that many parallel claim agents. 1 is collapsed+// of 2..12 turns on swarm with that many parallel claim agents. 1 is collapsed// to off (a one-agent swarm is just the single-issue flow with overhead), so// the smallest meaningful swarm is 2. Kept here so the sanitizer and the// claim-issue prompt-builder agree on the vocabulary.export const SWARM_COUNT_MIN = 2;-export const SWARM_COUNT_MAX = 6;+export const SWARM_COUNT_MAX = 12;// branch-reconcile coordinator batch size. Unlike claim-issue's swarm count,// this is the number of already-classified branches one coordinator receives@@ -1265,10 +1264,10 @@ export function sanitizeTaskMetadata(raw) {clean.issueExcludeLabels = normalizeIssueExcludeLabels(raw.issueExcludeLabels);hasKeys = true;}- // `swarmCount` turns claim-issue `--swarm` fan-out on (2..6 parallel agents)+ // `swarmCount` turns claim-issue `--swarm` fan-out on (2..12 parallel agents)// or off. 0 is kept as an explicit "off" (so a per-app override can disable// swarm even when the global default has it on — `0` = off, absent = inherit);- // 2..6 is the swarm size. 1/non-integer/out-of-range are dropped, so a+ // 2..12 is the swarm size. 1/non-integer/out-of-range are dropped, so a// hand-edited config can't smuggle in an unbounded swarm size. The prompt// builder treats anything below SWARM_COUNT_MIN as off (resolveSwarmBlock).if (Object.prototype.hasOwnProperty.call(raw, 'swarmCount')diff --git a/server/lib/validation.test.js b/server/lib/validation.test.jsindex d6657b621b..4dc139e2da 100644--- a/server/lib/validation.test.js+++ b/server/lib/validation.test.js@@ -1140,14 +1140,16 @@ describe('validation.js', () => {.toHaveLength(255);});- it('should accept swarmCount 0 + 2..6 and drop 1/out-of-range/non-integer', () => {+ it('should accept swarmCount 0 + 2..12 and drop 1/out-of-range/non-integer', () => {// 0 is an explicit "off" (kept so a per-app override can disable swarm).expect(sanitizeTaskMetadata({ swarmCount: 0 })).toEqual({ swarmCount: 0 });expect(sanitizeTaskMetadata({ swarmCount: 2 })).toEqual({ swarmCount: 2 });- expect(sanitizeTaskMetadata({ swarmCount: 6 })).toEqual({ swarmCount: 6 });+ for (const swarmCount of [6, 7, 12]) {+ expect(sanitizeTaskMetadata({ swarmCount })).toEqual({ swarmCount });+ }// 1 (a one-agent swarm is just the single-issue flow) and out-of-range are dropped.expect(sanitizeTaskMetadata({ swarmCount: 1 })).toBeNull();- expect(sanitizeTaskMetadata({ swarmCount: 7 })).toBeNull();+ expect(sanitizeTaskMetadata({ swarmCount: 13 })).toBeNull();expect(sanitizeTaskMetadata({ swarmCount: -1 })).toBeNull();// Non-integers can't smuggle an unbounded swarm size.expect(sanitizeTaskMetadata({ swarmCount: 3.5 })).toBeNull();diff --git a/server/services/cos.test.js b/server/services/cos.test.jsindex 35be10f441..c011b4fd63 100644--- a/server/services/cos.test.js+++ b/server/services/cos.test.js@@ -767,17 +767,18 @@ describe('localEndpointOfProvider (#4834)', () => {describe('cloudSwarmThreadCapacity', () => {it('reserves one root thread in addition to every configured cloud worker', () => {expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, 6)).toBe(7);- expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, '6')).toBe(7);+ expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, 12)).toBe(13);+ expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, '12')).toBe(13);});it('does not lift the harness cap for a local inference endpoint', () => {- expect(cloudSwarmThreadCapacity(LOCAL_TUI_PROVIDER, 6)).toBeNull();+ expect(cloudSwarmThreadCapacity(LOCAL_TUI_PROVIDER, 12)).toBeNull();});it('does not override the harness outside a valid multi-worker swarm', () => {expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, 1)).toBeNull();expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, 2.5)).toBeNull();- expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, 7)).toBeNull();+ expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, 13)).toBeNull();expect(cloudSwarmThreadCapacity(CLOUD_PROVIDER, null)).toBeNull();});});diff --git a/server/services/cosTaskPreStepBlocks.test.js b/server/services/cosTaskPreStepBlocks.test.jsindex a2edca9e4e..a1dc244c9d 100644--- a/server/services/cosTaskPreStepBlocks.test.js+++ b/server/services/cosTaskPreStepBlocks.test.js@@ -148,10 +148,10 @@ describe('resolveSwarmBlock', () => {});it('returns a gh swarm directive for the github claim body', () => {- const block = resolveSwarmBlock('claim-issue', 3);+ const block = resolveSwarmBlock('claim-issue', 12);expect(block).toContain('SWARM MODE');- expect(block).toContain('--swarm=3');- expect(block).toContain('3 independent issues');+ expect(block).toContain('--swarm=12');+ expect(block).toContain('12 independent issues');expect(block).toContain('gh pr merge');// Ends with a separator so the single-issue body reads as the per-agent flow.expect(block.trimEnd().endsWith('---')).toBe(true);diff --git a/server/services/cosTaskStore.test.js b/server/services/cosTaskStore.test.jsindex e2ca59fb58..5113612daa 100644--- a/server/services/cosTaskStore.test.js+++ b/server/services/cosTaskStore.test.js@@ -868,20 +868,20 @@ describe('cosTaskStore.addTask', () => {it('persists a manual claim swarm count through the task markdown round-trip', async () => {const created = await addTask({- description: 'Claim six independent GitHub issues for Example App',+ description: 'Claim twelve independent GitHub issues for Example App',app: 'example-app',- swarmCount: 6,+ swarmCount: 12,}, 'user');- expect(created.metadata.swarmCount).toBe(6);+ expect(created.metadata.swarmCount).toBe(12);const { tasks } = await getUserTasks();// Scalar task metadata parses from markdown as text; the lifecycle resolver// normalizes it with Number() before applying the bounded thread override.- expect(Number(tasks.find(t => t.id === created.id).metadata.swarmCount)).toBe(6);+ expect(Number(tasks.find(t => t.id === created.id).metadata.swarmCount)).toBe(12);});it('drops an out-of-range manual claim swarm count', async () => {- const created = await addTask({ description: 'Invalid claim swarm', swarmCount: 7 }, 'user');+ const created = await addTask({ description: 'Invalid claim swarm', swarmCount: 13 }, 'user');expect(created.metadata.swarmCount).toBeUndefined();});