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

fix(council): hide dynamic councillors from @ menu and drop PascalCase label

- Treat councillor-* agents as internal/hidden in getAgentConfigs so they
  no longer leak into the @ autocomplete (only the orchestrator dispatches
  them). Previously only the static "councillor" name was hidden, but the
  real agents are named councillor-<seat>.
- Remove the council agent's displayName so it falls back to its lowercase
  name ("council"), matching explorer/designer/oracle instead of showing
  PascalCase "Council".
- Add a test asserting councillor-<seat> is hidden and subagent-mode.
Michael Henke 3 недель назад
Родитель
Сommit
702c22ee6e
3 измененных файлов с 20 добавлено и 4 удалено
  1. 0 1
      src/agents/council.ts
  2. 15 0
      src/agents/display-name.test.ts
  3. 5 3
      src/agents/index.ts

+ 0 - 1
src/agents/council.ts

@@ -68,7 +68,6 @@ export function createCouncilAgent(
 
   return {
     name: 'council',
-    displayName: 'Council',
     description:
       'Multi-model consensus agent that synthesizes viewpoints from council members to make informed decisions with higher confidence than single models',
     config: {

+ 15 - 0
src/agents/display-name.test.ts

@@ -1,5 +1,6 @@
 import { describe, expect, test } from 'bun:test';
 import type { PluginConfig } from '../config';
+import { CouncilConfigSchema } from '../config/council-schema';
 import { createAgents, getAgentConfigs } from './index';
 
 describe('displayName', () => {
@@ -209,4 +210,18 @@ describe('displayName', () => {
     expect(sdkConfigs.reviewer).toBeUndefined();
     expect(sdkConfigs.councillor?.hidden).toBe(true);
   });
+
+  test('keeps dynamic councillor-<seat> agents hidden from @ autocomplete', () => {
+    const config: PluginConfig = {
+      disabled_agents: [],
+      council: CouncilConfigSchema.parse({
+        presets: { default: { alpha: { model: 'test/councillor' } } },
+      }),
+    };
+
+    const sdkConfigs = getAgentConfigs(config);
+
+    expect(sdkConfigs['councillor-alpha']?.hidden).toBe(true);
+    expect(sdkConfigs['councillor-alpha']?.mode).toBe('subagent');
+  });
 });

+ 5 - 3
src/agents/index.ts

@@ -696,8 +696,9 @@ export function getAgentConfigs(
       // Council is callable both as a primary agent (user-facing)
       // and as a subagent (orchestrator can delegate to it)
       sdkConfig.mode = 'all';
-    } else if (name === 'councillor') {
-      // Internal agent - subagent mode, hidden from @ autocomplete
+    } else if (name === 'councillor' || name.startsWith('councillor-')) {
+      // Internal agent - subagent mode, hidden from @ autocomplete.
+      // Dynamic councillors are named councillor-<seat> (see council-agents.ts).
       sdkConfig.mode = 'subagent';
       sdkConfig.hidden = true;
     } else if (isSubagent(name)) {
@@ -709,7 +710,8 @@ export function getAgentConfigs(
     }
   };
 
-  const isInternalOnly = (name: string): boolean => name === 'councillor';
+  const isInternalOnly = (name: string): boolean =>
+    name === 'councillor' || name.startsWith('councillor-');
 
   const entries: Array<[string, SDKAgentConfig]> = [];