-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Markdown w/ Frontmatter Agent Parser #16094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add FrontmatterRemoteAgentDefinition and Zod schema for remote agents - Support 'kind: remote' and 'agent_card_url' in markdown frontmatter - Allow optional body for remote agents in parser - Update loader tests to cover remote agent scenarios
- Flatten localAgentSchema to support top-level 'system_prompt' and 'query' in frontmatter - Remove nested 'prompts' object from schema and interface - Clean up excessive blank lines in loader.ts - Update tests to reflect schema changes and verify top-level prompt fields
Summary of ChangesHello @sehoon38, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant refactoring of how agents are defined and loaded within the system. By transitioning from TOML to Markdown files with YAML frontmatter, the change aims to streamline the agent definition process, allowing for more intuitive system prompt specification directly within the Markdown body. This update enhances the flexibility and maintainability of agent configurations, ensuring a more robust and user-friendly approach to managing agent definitions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +477 B (0%) Total Size: 22.3 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the agent definition loader, migrating from TOML files to Markdown with YAML frontmatter, involving the replacement of the TOML parser with "js-yaml" and updates to data structures, validation schemas, and file loading logic. However, a critical insecure deserialization vulnerability was identified due to the use of yaml.load() on untrusted file content, which can lead to Remote Code Execution. A high-severity Server-Side Request Forgery (SSRF) vulnerability was also found, as the agent_card_url is not properly sanitized. Additionally, a high-severity correctness bug was identified. Immediate remediation is recommended for these issues before merging.
- Rename packages/core/src/agents/loader.ts to agentLoader.ts - Rename packages/core/src/agents/loader.test.ts to agentLoader.test.ts - Update imports in registry.ts and registry.test.ts - Add parsing for remote agents list in markdown frontmatter - Update tests to verify single and multiple remote agents parsing
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
Migrate to use md w/ Frontmatter instead of toml files.
Details
Markdown is increasingly becoming the industry standard. Transitioning to this format ensures consistency and simplifies the developer experience.
Related Issues
Fixes #15968
How to Validate
Also testing multi-remote agents
Pre-Merge Checklist