The best way to control Claude Code, Codex and more from any computer or phone
fix(cursor): grep count results say "1 match", not "1 matches" (#26065)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
MarcoDotIO committed
Oct 31, 2026 at 04:36 UTC
a83ab55e80db8ae919f7d1ccd19c1be291ff60d5
2 files changed
+35
-1
packages/provider-cursor/src/server/adapter.test.ts
+34
@@ -865,6 +865,32 @@ describe("CursorAdapterV2", () => {
865
result: { status: "error", error: "search failed" },
866
},
867
},
868
+ {
869
+ type: "tool-call-completed",
870
+ modelCallId: "native-model-call",
871
+ callId: "grep-counts",
872
+ toolCall: {
873
+ type: "grep",
874
+ args: { pattern: "TODO", outputMode: "count" },
875
+ result: {
876
+ status: "success",
877
+ value: {
878
+ workspaceResults: {
879
+ [workspace]: {
880
+ type: "count",
881
+ output: {
882
+ counts: [
883
+ { file: "src/a.ts", count: 1 },
884
+ { file: "src/b.ts", count: 3 },
885
+ ],
886
+ total: 4,
887
+ },
888
+ },
889
+ },
890
+ },
891
+ },
892
+ },
893
+ },
894
{
895
type: "tool-call-completed",
896
modelCallId: "native-model-call",
@@ -1115,6 +1141,14 @@ describe("CursorAdapterV2", () => {
1141
status: "failed",
1142
results: [{ fileName: "src", preview: "search failed" }],
1143
},
1144
+ {
1145
+ pattern: "TODO",
1146
+ status: "completed",
1147
+ results: [
1148
+ { fileName: "src/a.ts", preview: "1 match" },
1149
+ { fileName: "src/b.ts", preview: "3 matches" },
1150
+ ],
1151
+ },
1152
{
1153
pattern: "*.ts",
1154
status: "failed",
packages/provider-cursor/src/server/adapter.ts
+1
-1
@@ -477,7 +477,7 @@ function cursorToolSearchResults(
477
if (result.type === "count") {
478
return result.output.counts.map((entry) => ({
479
fileName: entry.file,
480
- preview: `${entry.count} matches`,
480
+ preview: `${entry.count} ${entry.count === 1 ? "match" : "matches"}`,
481
}));
482
}
483
return result.output.matches.map((entry) => ({