-
Notifications
You must be signed in to change notification settings - Fork 1.5k
visual display of handoffs on readme #434
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
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.
Pull request overview
This pull request adds visual indicators to display handoff capabilities in the README for custom agents. The feature allows users to quickly identify which agents support handoffs to other agents, a VS Code-specific feature that enables seamless context transfer between specialized agents.
Key Changes:
- Added a
getHandoffs()function to parse handoff metadata from agent frontmatter - Updated the agent table generation to display handoff labels with a 🔄 emoji indicator
- Added documentation about handoffs in the "How to Use Custom Agents" section
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| eng/update-readme.mjs | Added getHandoffs() function to extract handoff information from agent files and integrated handoff display logic into the agent table generation |
| eng/constants.mjs | Added "Handoffs" documentation section explaining the handoff feature with a link to VS Code documentation |
| docs/README.agents.md | Shows the generated output with handoff documentation and example handoff indicator for the Context7 agent |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| try { | ||
| const frontmatter = parseFrontmatter(filePath); | ||
| if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) { | ||
| return frontmatter.handoffs.map(h => ({ | ||
| label: h.label || 'Unknown handoff', | ||
| agent: h.agent || 'unknown' | ||
| })); | ||
| } | ||
| return null; | ||
| } catch (error) { | ||
| return null; | ||
| } |
Copilot
AI
Nov 26, 2025
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.
The try-catch block here is redundant since parseFrontmatter already uses safeFileOperation which handles errors internally and returns null on failure. The try-catch can be removed to follow the pattern used by other similar functions in this file like extractDescription (line 190-204).
| try { | |
| const frontmatter = parseFrontmatter(filePath); | |
| if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) { | |
| return frontmatter.handoffs.map(h => ({ | |
| label: h.label || 'Unknown handoff', | |
| agent: h.agent || 'unknown' | |
| })); | |
| } | |
| return null; | |
| } catch (error) { | |
| return null; | |
| } | |
| const frontmatter = parseFrontmatter(filePath); | |
| if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) { | |
| return frontmatter.handoffs.map(h => ({ | |
| label: h.label || 'Unknown handoff', | |
| agent: h.agent || 'unknown' | |
| })); | |
| } | |
| return null; |
| try { | ||
| const frontmatter = parseFrontmatter(filePath); | ||
| if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) { | ||
| return frontmatter.handoffs.map(h => ({ |
Copilot
AI
Nov 26, 2025
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.
The arrow function parameter should use parentheses for consistency with the rest of the codebase. Change h => to (h) => to match the style used in other .map() calls throughout this file (see lines 63, 106, 235, 294, 388, 475, 546, 623).
| return frontmatter.handoffs.map(h => ({ | |
| return frontmatter.handoffs.map((h) => ({ |
| if (badgeType === "agent") { | ||
| const handoffs = getHandoffs(filePath); | ||
| if (handoffs && handoffs.length > 0) { | ||
| const handoffLabels = handoffs.map(h => h.label).join(', '); |
Copilot
AI
Nov 26, 2025
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.
The arrow function parameter should use parentheses for consistency with the rest of the codebase. Change h => to (h) => to match the style used in other .map() calls throughout this file (see lines 63, 106, 235, 294, 388, 475, 546, 623).
| const handoffLabels = handoffs.map(h => h.label).join(', '); | |
| const handoffLabels = handoffs.map((h) => h.label).join(', '); |
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.Description
Type of Contribution
Additional Notes
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.