Skip to content

Commit 2cd2edf

Browse files
fix(web): omit search query from tool metadata
1 parent e0995b9 commit 2cd2edf

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

packages/web/src/features/tools/glob.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { z } from "zod";
22
import { isServiceError } from "@/lib/utils";
33
import { search } from "@/features/search";
4-
import type { QueryIR } from "@/features/search/ir";
54
import { Source, ToolDefinition } from "./types";
65
import { logger } from "./logger";
76
import description from "./glob.txt";
@@ -50,7 +49,6 @@ export type GlobRepoInfo = {
5049
export type GlobMetadata = {
5150
files: GlobFile[];
5251
pattern: string;
53-
query: QueryIR;
5452
fileCount: number;
5553
repoCount: number;
5654
repoInfoMap: Record<string, GlobRepoInfo>;
@@ -129,7 +127,6 @@ export const globDefinition: ToolDefinition<'glob', typeof globShape, GlobMetada
129127
const metadata: GlobMetadata = {
130128
files,
131129
pattern,
132-
query,
133130
fileCount: files.length,
134131
repoCount: new Set(files.map((f) => f.repo)).size,
135132
repoInfoMap,

packages/web/src/features/tools/grep.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { z } from "zod";
22
import { isServiceError } from "@/lib/utils";
33
import { search } from "@/features/search";
4-
import type { QueryIR } from "@/features/search/ir";
54
import { Source, ToolDefinition } from "./types";
65
import { logger } from "./logger";
76
import description from "./grep.txt";
@@ -61,7 +60,6 @@ export type GrepRepoInfo = {
6160
export type GrepMetadata = {
6261
files: GrepFile[];
6362
pattern: string;
64-
query: QueryIR;
6563
matchCount: number;
6664
repoCount: number;
6765
repoInfoMap: Record<string, GrepRepoInfo>;
@@ -142,7 +140,6 @@ export const grepDefinition: ToolDefinition<'grep', typeof grepShape, GrepMetada
142140
const metadata: GrepMetadata = {
143141
files,
144142
pattern,
145-
query,
146143
matchCount: response.stats.actualMatchCount,
147144
repoCount: new Set(files.map((f) => f.repo)).size,
148145
repoInfoMap,

packages/web/src/features/tools/searchTools.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('agent search tools', () => {
3939
});
4040

4141
it('executes grep with QueryIR', async () => {
42-
await grepDefinition.execute({
42+
const result = await grepDefinition.execute({
4343
pattern: 'needle',
4444
path: 'src/my dir',
4545
limit: 25,
@@ -61,10 +61,11 @@ describe('agent search tools', () => {
6161
},
6262
source: 'test',
6363
});
64+
expect(result.metadata).not.toHaveProperty('query');
6465
});
6566

6667
it('executes glob with QueryIR', async () => {
67-
await globDefinition.execute({
68+
const result = await globDefinition.execute({
6869
pattern: 'My Folder/**/*.ts',
6970
ref: 'feature/my feature',
7071
}, {
@@ -85,5 +86,6 @@ describe('agent search tools', () => {
8586
},
8687
source: 'test',
8788
});
89+
expect(result.metadata).not.toHaveProperty('query');
8890
});
8991
});

0 commit comments

Comments
 (0)