Skip to content

Commit e9bdbce

Browse files
rajbosCopilot
andcommitted
Add case-insensitive dedup check to Toolnames checkup workflow
When the 'Toolnames checkup' label is applied to an issue, the workflow now performs a case-insensitive lookup in addition to the exact match. Tool names that differ only in capitalisation from an existing entry are surfaced in a new '⚠️ Case variant' section and explicitly flagged as 'do not add', preventing the agent from creating duplicate PascalCase entries (e.g. Grep when grep already exists). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a87fb97 commit e9bdbce

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/check-toolnames.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,21 @@ jobs:
9090
9191
already_added = []
9292
needs_adding = []
93+
case_variants = []
9394
9495
for tool in tools:
9596
if tool in known_tools:
9697
already_added.append((tool, known_tools[tool]))
9798
else:
98-
needs_adding.append(tool)
99+
# Case-insensitive check: if a differently-cased variant already
100+
# exists with the same friendly name, flag it as a case variant
101+
# rather than a missing entry — it should NOT be added separately.
102+
lower_tool = tool.lower()
103+
case_match = next((k for k in known_tools if k.lower() == lower_tool), None)
104+
if case_match and known_tools[case_match] == known_tools.get(tool, known_tools[case_match]):
105+
case_variants.append((tool, case_match, known_tools[case_match]))
106+
else:
107+
needs_adding.append(tool)
99108
100109
lines = ["## 🔍 Toolnames Checkup", ""]
101110
lines.append("Checked the tool names in this issue against `vscode-extension/src/toolNames.json` on the `main` branch:")
@@ -110,6 +119,18 @@ jobs:
110119
lines.append(f"| `{tool}` | {friendly} |")
111120
lines.append("")
112121
122+
if case_variants:
123+
lines.append("### ⚠️ Case variant of an existing entry — do not add")
124+
lines.append("")
125+
lines.append("These tool names differ only in capitalisation from an entry that is already mapped.")
126+
lines.append("**Do not add a separate entry** — the existing lowercase form covers this tool.")
127+
lines.append("")
128+
lines.append("| Tool Name (from issue) | Existing Entry | Friendly Name |")
129+
lines.append("| --- | --- | --- |")
130+
for tool, existing, friendly in case_variants:
131+
lines.append(f"| `{tool}` | `{existing}` | {friendly} |")
132+
lines.append("")
133+
113134
if needs_adding:
114135
lines.append("### ❌ Not yet in `toolNames.json`")
115136
lines.append("")
@@ -119,8 +140,10 @@ jobs:
119140
lines.append(f"| `{tool}` |")
120141
lines.append("")
121142
122-
if already_added and not needs_adding:
143+
if already_added and not needs_adding and not case_variants:
123144
lines.append("> **All tool names in this issue are already mapped.** This issue may be a duplicate — consider closing it.")
145+
elif case_variants and not needs_adding:
146+
lines.append("> **All unmapped tool names are case variants of existing entries.** No new entries should be added. Consider closing this issue.")
124147
elif needs_adding:
125148
lines.append(f"> **{len(needs_adding)} tool name(s) still need to be added.** Please use the `tool-names` custom agent or update `vscode-extension/src/toolNames.json` manually.")
126149

0 commit comments

Comments
 (0)