mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat: add built-in agent(general-purpose)
This commit is contained in:
@@ -584,11 +584,12 @@ System prompt 3`);
|
||||
it('should list subagents from both levels', async () => {
|
||||
const subagents = await manager.listSubagents();
|
||||
|
||||
expect(subagents).toHaveLength(3); // agent1 (project takes precedence), agent2, agent3
|
||||
expect(subagents).toHaveLength(4); // agent1 (project takes precedence), agent2, agent3, general-purpose (built-in)
|
||||
expect(subagents.map((s) => s.name)).toEqual([
|
||||
'agent1',
|
||||
'agent2',
|
||||
'agent3',
|
||||
'general-purpose',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -615,7 +616,7 @@ System prompt 3`);
|
||||
});
|
||||
|
||||
const names = subagents.map((s) => s.name);
|
||||
expect(names).toEqual(['agent1', 'agent2', 'agent3']);
|
||||
expect(names).toEqual(['agent1', 'agent2', 'agent3', 'general-purpose']);
|
||||
});
|
||||
|
||||
it('should handle empty directories', async () => {
|
||||
@@ -626,7 +627,9 @@ System prompt 3`);
|
||||
|
||||
const subagents = await manager.listSubagents();
|
||||
|
||||
expect(subagents).toHaveLength(0);
|
||||
expect(subagents).toHaveLength(1); // Only built-in agents remain
|
||||
expect(subagents[0].name).toBe('general-purpose');
|
||||
expect(subagents[0].level).toBe('builtin');
|
||||
});
|
||||
|
||||
it('should handle directory read errors', async () => {
|
||||
@@ -636,7 +639,9 @@ System prompt 3`);
|
||||
|
||||
const subagents = await manager.listSubagents();
|
||||
|
||||
expect(subagents).toHaveLength(0);
|
||||
expect(subagents).toHaveLength(1); // Only built-in agents remain
|
||||
expect(subagents[0].name).toBe('general-purpose');
|
||||
expect(subagents[0].level).toBe('builtin');
|
||||
});
|
||||
|
||||
it('should skip invalid subagent files', async () => {
|
||||
@@ -656,7 +661,7 @@ System prompt 3`);
|
||||
|
||||
const subagents = await manager.listSubagents();
|
||||
|
||||
expect(subagents).toHaveLength(1);
|
||||
expect(subagents).toHaveLength(2); // 1 valid file + 1 built-in agent
|
||||
expect(consoleSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Skipping invalid subagent file'),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user