feat: wire agent.delegate tool with sub-agent configs

- Export createAgentDelegateTool through builtin/index.ts → tools/index.ts
- Register agent.delegate in routing.ts with lazy orchestrator pattern
- Add agent.delegate + agents.list to messaging and coding policy profiles
- Add group:agents tool group to policy.ts
- Add research/code/comms agent config examples to default.yaml
- Add research/code/comms agent configs to user config.yaml
- Add 11 tests for agent-delegate tool (all pass)
- Typecheck clean, no regressions
This commit is contained in:
William Valentin
2026-02-17 10:28:29 -08:00
parent 288ef5ac3c
commit 776b47f80f
16 changed files with 890 additions and 4 deletions
+42
View File
@@ -357,6 +357,7 @@ describe('configSchema — agent_configs', () => {
assistant: {
system_prompt: 'You are helpful.',
model_tier: 'default',
backend: 'codex',
tool_profile: 'messaging',
},
coder: {
@@ -367,11 +368,52 @@ describe('configSchema — agent_configs', () => {
},
});
expect(result.agent_configs.assistant.system_prompt).toBe('You are helpful.');
expect(result.agent_configs.assistant.backend).toBe('codex');
expect(result.agent_configs.assistant.tool_profile).toBe('messaging');
expect(result.agent_configs.coder.sandbox).toBe(true);
});
});
describe('configSchema — backends', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
};
it('defaults backend config fields', () => {
const result = configSchema.parse(minimalConfig);
expect(result.backends.claude_code.enabled).toBe(false);
expect(result.backends.claude_code.args).toEqual([]);
expect(result.backends.claude_code.timeout_ms).toBe(120000);
expect(result.backends.opencode.enabled).toBe(false);
expect(result.backends.opencode.args).toEqual([]);
expect(result.backends.codex.enabled).toBe(false);
expect(result.backends.gemini.enabled).toBe(false);
expect(result.backends.native.enabled).toBe(true);
});
it('accepts explicit codex/gemini backend config', () => {
const result = configSchema.parse({
...minimalConfig,
backends: {
default: 'codex',
codex: { enabled: true, path: '/usr/local/bin/codex', args: ['run'], timeout_ms: 300000 },
gemini: { enabled: true, path: '/usr/local/bin/gemini', args: ['chat'], timeout_ms: 60000 },
},
});
expect(result.backends.default).toBe('codex');
expect(result.backends.codex.enabled).toBe(true);
expect(result.backends.codex.path).toBe('/usr/local/bin/codex');
expect(result.backends.codex.args).toEqual(['run']);
expect(result.backends.codex.timeout_ms).toBe(300000);
expect(result.backends.gemini.enabled).toBe(true);
expect(result.backends.gemini.path).toBe('/usr/local/bin/gemini');
expect(result.backends.gemini.args).toEqual(['chat']);
expect(result.backends.gemini.timeout_ms).toBe(60000);
});
});
describe('configSchema — routing', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },