Skip to content

Commit d2c443f

Browse files
committed
fix(blocks): fall back to model args for empty carousel media, blank share emails, and boolean enabled filters
1 parent 71257d3 commit d2c443f

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎apps/sim/blocks/blocks/file.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,13 +2203,16 @@ export const FileV5Block: BlockConfig = {
22032203
throw new Error('File is required to manage sharing')
22042204
}
22052205

2206-
const allowedEmails =
2206+
const rowEmails =
22072207
typeof params.shareAllowedEmails === 'string'
22082208
? params.shareAllowedEmails
22092209
.split(/[\n,]/)
22102210
.map((email) => email.trim())
22112211
.filter(Boolean)
2212-
: toolCallArg(context, params.allowedEmails)
2212+
: undefined
2213+
const allowedEmails = rowEmails?.length
2214+
? rowEmails
2215+
: (toolCallArg(context, params.allowedEmails) ?? rowEmails)
22132216

22142217
/* A tool row has no visibility dropdown, so a tool call states the link
22152218
with the tool's own `isActive` / `authType` args. */

‎apps/sim/blocks/blocks/instagram.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,9 @@ Return ONLY the timestamp or date - no explanations, no extra text.`,
805805
const resolved = normalizeFileInput(params.media, { single: true })
806806
if (resolved) result.media = resolved
807807
} else if (operation === 'instagram_publish_carousel') {
808-
const resolved = normalizeFileInput(
809-
params.carouselMedia || toolCallArg(context, params.media)
810-
)
808+
const resolved =
809+
normalizeFileInput(params.carouselMedia) ??
810+
normalizeFileInput(toolCallArg(context, params.media))
811811
if (resolved) result.media = resolved
812812
}
813813

‎apps/sim/blocks/blocks/knowledge.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,11 @@ export const KnowledgeBlock: BlockConfig = {
497497
if (params.chunkEnabledFilter) {
498498
const modelEnabled =
499499
params.chunkEnabledFilter === 'all' ? toolCallArg(context, params.enabled) : undefined
500-
params.enabled = modelEnabled || params.chunkEnabledFilter
500+
/* The tool takes a string; a model may send the boolean `false`, which must survive. */
501+
params.enabled =
502+
modelEnabled === undefined || modelEnabled === null || modelEnabled === ''
503+
? params.chunkEnabledFilter
504+
: String(modelEnabled)
501505
}
502506
}
503507

0 commit comments

Comments
 (0)