← Back to PRs

#19164: fix(discord): dedupe native skill commands across agents by skill name

by seewhyme open 2026-02-17 13:25 View on GitHub →
size: XS
## Summary - follow-up to #17365 - de-duplicate skill native command specs across agents/workspaces by canonical `skillName` before Discord registration - keep unique skills intact; only drop true duplicates that currently surface as suffixed variants (for example `_2`) ## Why `skillName` duplicates can still enter the final native command set when multiple agents/workspaces expose the same skill. That can lead to suffixed command variants being registered on Discord depending on ordering/reconciliation. ## Changes - `src/auto-reply/skill-commands.ts` - added `seenSkillNames` tracking in `listSkillCommandsForAgents` - skip duplicate entries when the same normalized `skillName` is encountered again - `src/auto-reply/skill-commands.test.ts` - updated expectations to assert duplicate skill command variants are not emitted ## Validation - `pnpm exec vitest run --config vitest.unit.config.ts src/auto-reply/skill-commands.test.ts src/discord/monitor/provider.skill-dedupe.test.ts` - both test files pass <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR moves skill command deduplication from the Discord provider layer to the core `listSkillCommandsForAgents` function. By tracking seen skill names (normalized to lowercase) during command collection, it prevents duplicate skill commands with `_2` suffixes from being created in the first place, rather than filtering them out later at the Discord registration stage. <h3>Confidence Score: 5/5</h3> - Safe to merge with no issues found - The implementation is clean and correct, moves deduplication to an earlier and more logical place in the pipeline, includes proper test coverage with updated assertions, and follows the existing code patterns - No files require special attention <sub>Last reviewed commit: 9c66eaf</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs