File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -525,9 +525,7 @@ export const MondayBlock: BlockConfig = {
525525 const baseParams : Record < string , unknown > = {
526526 oauthCredential : params . oauthCredential ,
527527 }
528- /** Agent tool calls carry the stored operation only on `context`, not in `params`. */
529- const rawOperation = mapperOperation ( params , context )
530- const op = typeof rawOperation === 'string' ? rawOperation . trim ( ) : 'list_boards'
528+ const op = mapperOperation ( params , context ) . trim ( ) || 'list_boards'
531529
532530 switch ( op ) {
533531 case 'list_boards' :
Original file line number Diff line number Diff line change @@ -2526,7 +2526,7 @@ export const QuickBooksBlock: BlockConfig = {
25262526 return operation
25272527 } ,
25282528 params : ( params , context ) => {
2529- const operation = String ( mapperOperation ( params , context ) )
2529+ const operation = mapperOperation ( params , context )
25302530 const oauthCredentialValue = params . oauthCredential
25312531 /**
25322532 * Resolves a tool param filled by a differently-named subBlock. On an agent tool call
Original file line number Diff line number Diff line change @@ -952,14 +952,15 @@ export function toolCallArg<T>(
952952 * The operation a block's `tools.config.params` mapper runs for. A tool call passes it only in
953953 * `context`: a stored tool row keeps its operation outside its params, and a tool that declares its
954954 * own `operation` param (Slack `edit_canvas`) gets the model's value there. The canvas passes no
955- * context, so the block's serialized `operation` input is used.
955+ * context, so the block's serialized `operation` input is used. Returns `''` when neither supplies
956+ * one, so a default needs `||`, not `??`.
956957 */
957958export function mapperOperation (
958959 params : { operation ?: unknown } ,
959960 context : BlockToolParamsContext | undefined
960- ) : string | undefined {
961+ ) : string {
961962 if ( context ?. operation ) return context . operation
962- return typeof params . operation === 'string' ? params . operation : undefined
963+ return typeof params . operation === 'string' ? params . operation : ''
963964}
964965
965966/**
You can’t perform that action at this time.
0 commit comments