Просмотр исходного кода

fix(council): check prefixed councillor name against disabled set

buildCouncillorAgents registers seats as 'councillor-<name>' but the
disabled check compared the raw seat name, so disabling a councillor
via the prefixed name never matched. Check the prefixed agentName
instead, consistent with registration.
Michael Henke 1 месяц назад
Родитель
Сommit
a20f752e44
2 измененных файлов с 3 добавлено и 6 удалено
  1. 2 5
      src/agents/council-agents.test.ts
  2. 1 1
      src/agents/council-agents.ts

+ 2 - 5
src/agents/council-agents.test.ts

@@ -69,10 +69,7 @@ describe('buildCouncillorAgents', () => {
             model: 'openai/gpt-5.6',
             variant: undefined,
             prompt: undefined,
-            models: [
-              { id: 'openai/gpt-5.6' },
-              { id: 'anthropic/claude-opus' },
-            ],
+            models: [{ id: 'openai/gpt-5.6' }, { id: 'anthropic/claude-opus' }],
           },
         },
       },
@@ -110,7 +107,7 @@ describe('buildCouncillorAgents', () => {
       },
     });
 
-    const agents = buildCouncillorAgents(config, new Set(['alpha']));
+    const agents = buildCouncillorAgents(config, new Set(['councillor-alpha']));
     expect(agents).toHaveLength(1);
     expect(agents[0].name).toBe('councillor-beta');
   });

+ 1 - 1
src/agents/council-agents.ts

@@ -25,9 +25,9 @@ export function buildCouncillorAgents(
   const agents: AgentDefinition[] = [];
   for (const [name, cfg] of Object.entries(preset)) {
     if (name === 'master') continue;
-    if (disabled.has(name)) continue;
 
     const agentName = `${COUNCILLOR_AGENT_PREFIX}${name}`;
+    if (disabled.has(agentName)) continue;
     const base = createCouncillorAgent(cfg.model, undefined, cfg.prompt);
 
     // If a fallback chain is configured, attach _modelArray for runtime