File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
packages/bytebot-agent-cc/src/agent Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -123,24 +123,25 @@ export class AgentProcessor {
123123 private formatAnthropicResponse (
124124 content : Anthropic . ContentBlock [ ] ,
125125 ) : MessageContentBlock [ ] {
126+ // filter out tool_use blocks that aren't computer tool uses
127+ content = content . filter (
128+ ( block ) =>
129+ block . type !== 'tool_use' || block . name . startsWith ( 'mcp__desktop__' ) ,
130+ ) ;
126131 return content . map ( ( block ) => {
127132 switch ( block . type ) {
128133 case 'text' :
129134 return {
130135 type : MessageContentType . Text ,
131136 text : block . text ,
132137 } as TextContentBlock ;
133-
134138 case 'tool_use' :
135- if ( isComputerToolUseContentBlock ( block ) ) {
136- return {
137- type : MessageContentType . ToolUse ,
138- id : block . id ,
139- name : block . name . replace ( 'mcp__desktop__' , '' ) ,
140- input : block . input ,
141- } as ToolUseContentBlock ;
142- }
143- break ;
139+ return {
140+ type : MessageContentType . ToolUse ,
141+ id : block . id ,
142+ name : block . name . replace ( 'mcp__desktop__' , '' ) ,
143+ input : block . input ,
144+ } as ToolUseContentBlock ;
144145 case 'thinking' :
145146 return {
146147 type : MessageContentType . Thinking ,
You can’t perform that action at this time.
0 commit comments