feat(agents): improve UI feedback and parser reliability (#16459)

This commit is contained in:
N. Taylor Mullen
2026-01-12 16:20:28 -08:00
committed by GitHub
parent 6ef2a92233
commit 548641c952
4 changed files with 39 additions and 2 deletions
@@ -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', () => {