mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 13:22:35 -07:00
feat(agents): improve UI feedback and parser reliability (#16459)
This commit is contained in:
@@ -198,6 +198,32 @@ agent_card_url: https://example.com/card
|
||||
agent_card_url: 'https://example.com/2',
|
||||
});
|
||||
});
|
||||
|
||||
it('should parse frontmatter without a trailing newline', async () => {
|
||||
const filePath = await writeAgentMarkdown(`---
|
||||
kind: remote
|
||||
name: no-trailing-newline
|
||||
agent_card_url: https://example.com/card
|
||||
---`);
|
||||
const result = await parseAgentMarkdown(filePath);
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toEqual({
|
||||
kind: 'remote',
|
||||
name: 'no-trailing-newline',
|
||||
agent_card_url: 'https://example.com/card',
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw AgentLoadError if agent name is not a valid slug', async () => {
|
||||
const filePath = await writeAgentMarkdown(`---
|
||||
name: Invalid Name With Spaces
|
||||
description: Test
|
||||
---
|
||||
Body`);
|
||||
await expect(parseAgentMarkdown(filePath)).rejects.toThrow(
|
||||
/Name must be a valid slug/,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('markdownToAgentDefinition', () => {
|
||||
|
||||
Reference in New Issue
Block a user