File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ import {
1515import { MAX_AGENT_STEPS_DEFAULT } from '../../common/src/constants/agents'
1616import { API_KEY_ENV_VAR } from '../../common/src/old-constants'
1717import { toolNames } from '../../common/src/tools/constants'
18+ import type { PublishedClientToolName } from '../../common/src/tools/list'
1819import {
1920 clientToolCallSchema ,
2021 type ClientToolCall ,
2122 type ClientToolName ,
2223 type CodebuffToolOutput ,
23- PublishedClientToolName ,
2424} from '../../common/src/tools/list'
2525
2626import type { CustomToolDefinition } from './custom-tool'
@@ -309,12 +309,13 @@ export class CodebuffClient {
309309 private async handleToolCall (
310310 action : ServerAction < 'tool-call-request' > ,
311311 ) : ReturnType < WebSocketHandler [ 'handleToolCall' ] > {
312- clientToolCallSchema . parse ( action )
313312 const toolName = action . toolName
314313 const input = action . input
315314
316315 let result : ToolResultOutput [ ]
317- if ( ! toolNames . includes ( toolName as ToolName ) ) {
316+ if ( toolNames . includes ( toolName as ToolName ) ) {
317+ clientToolCallSchema . parse ( action )
318+ } else {
318319 const customToolHandler =
319320 this . promptIdToHandlers [ action . userInputId ] . customToolHandler
320321 if ( ! customToolHandler ) {
You can’t perform that action at this time.
0 commit comments