Skip to content

Commit 46e8964

Browse files
committed
Tool fixes
1 parent 844c9a2 commit 46e8964

3 files changed

Lines changed: 3 additions & 29 deletions

File tree

apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function parseBlocks(blocks: ContentBlock[]): MessageSegment[] {
165165
if (block.type === 'tool_call') {
166166
if (!block.toolCall) continue
167167
const tc = block.toolCall
168-
if (tc.name === 'tool_search_tool_regex' || tc.name === 'grep' || tc.name === 'glob') continue
168+
if (tc.name === 'tool_search_tool_regex') continue
169169
const isDispatch = SUBAGENT_KEYS.has(tc.name) && !tc.calledBy
170170

171171
if (isDispatch) {

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ export function useChat(
738738
const isPartial = data?.partial === true
739739
if (!id) break
740740

741-
if (name === 'tool_search_tool_regex' || name === 'grep' || name === 'glob') {
741+
if (name === 'tool_search_tool_regex') {
742742
break
743743
}
744744
const ui = parsed.ui || data?.ui

apps/sim/lib/copilot/store-utils.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const logger = createLogger('CopilotStoreUtils')
3434

3535
/** Respond tools are internal handoff tools shown with a friendly generic label. */
3636
const HIDDEN_TOOL_SUFFIX = '_respond'
37-
const HIDDEN_TOOL_NAMES = new Set(['tool_search_tool_regex', 'grep', 'glob'])
37+
const HIDDEN_TOOL_NAMES = new Set(['tool_search_tool_regex'])
3838

3939
/** UI metadata sent by the copilot on SSE tool_call events. */
4040
export interface ServerToolUI {
@@ -133,18 +133,6 @@ function specialToolDisplay(
133133
}
134134
}
135135

136-
const searchQuery =
137-
readStringParam(params, 'pattern') ||
138-
readStringParam(params, 'query') ||
139-
readStringParam(params, 'glob')
140-
141-
if ((toolName === 'grep' || toolName === 'glob') && searchQuery) {
142-
return {
143-
text: formatSearchingLabel(searchQuery, state),
144-
icon: Search,
145-
}
146-
}
147-
148136
if (toolName === 'read') {
149137
const target = describeReadTarget(readStringParam(params, 'path'))
150138
return {
@@ -178,20 +166,6 @@ function readStringParam(
178166
return typeof value === 'string' && value.trim() ? value.trim() : undefined
179167
}
180168

181-
function formatSearchingLabel(query: string, state: ClientToolCallState): string {
182-
switch (state) {
183-
case ClientToolCallState.success:
184-
return `Searched for ${query}`
185-
case ClientToolCallState.error:
186-
return `Failed searching for ${query}`
187-
case ClientToolCallState.rejected:
188-
case ClientToolCallState.aborted:
189-
return `Skipped searching for ${query}`
190-
default:
191-
return `Searching for ${query}`
192-
}
193-
}
194-
195169
function formatReadingLabel(target: string | undefined, state: ClientToolCallState): string {
196170
const suffix = target ? ` ${target}` : ''
197171
switch (state) {

0 commit comments

Comments
 (0)