INNER CODE UNIT · TypeScript
collectArchitectRole
ZaxbyHub/opencode-swarm · src/agents/index.ts:1096
const collectArchitectRole = (): string[] =>
agentNames.filter((n) => stripKnownSwarmPrefix(n) === 'architect');
const trimmed =
typeof defaultAgent === 'string' ? defaultAgent.trim() : undefined;
const value = trimmed === '' ? undefined : trimmed;
if (agentNames.length === 0) {
return { primaryNames: new Set(), reason: 'implicit-architects' };
}
// Implicit: omitted default_agent ⇒ all architect-role agents.
if (value === undefined) {
const architects = collectArchitectRole();
if (architects.length > 0) {
return {
primaryNames: new Set(architects),
reason: 'implicit-architects',