Skip to content

Commit b8ad167

Browse files
committed
fix(google): clamp Pollen days to 1-5; stop forwarding stale group settings fields
Address Cursor Bugbot: - Pollen: clamp days to the documented 1-5 range (truncating fractionals) so 0, negatives, or >5 can't be sent to the API. - Google Groups update_settings: the block has no dedicated settings subblocks, so forwarding name/description from params could leak stale values from create_group/update_group and unintentionally rename the group. Forward only oauthCredential + groupEmail from the block (the tool's own param schema still exposes the settings fields for the agent path).
1 parent 3d6ad78 commit b8ad167

2 files changed

Lines changed: 5 additions & 33 deletions

File tree

apps/sim/blocks/blocks/google_groups.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -415,38 +415,6 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
415415
return {
416416
oauthCredential,
417417
groupEmail: rest.groupEmail,
418-
name: rest.name,
419-
description: rest.description,
420-
whoCanJoin: rest.whoCanJoin,
421-
whoCanViewMembership: rest.whoCanViewMembership,
422-
whoCanViewGroup: rest.whoCanViewGroup,
423-
whoCanPostMessage: rest.whoCanPostMessage,
424-
allowExternalMembers: rest.allowExternalMembers,
425-
allowWebPosting: rest.allowWebPosting,
426-
primaryLanguage: rest.primaryLanguage,
427-
isArchived: rest.isArchived,
428-
archiveOnly: rest.archiveOnly,
429-
messageModerationLevel: rest.messageModerationLevel,
430-
spamModerationLevel: rest.spamModerationLevel,
431-
replyTo: rest.replyTo,
432-
customReplyTo: rest.customReplyTo,
433-
includeCustomFooter: rest.includeCustomFooter,
434-
customFooterText: rest.customFooterText,
435-
sendMessageDenyNotification: rest.sendMessageDenyNotification,
436-
defaultMessageDenyNotificationText: rest.defaultMessageDenyNotificationText,
437-
membersCanPostAsTheGroup: rest.membersCanPostAsTheGroup,
438-
includeInGlobalAddressList: rest.includeInGlobalAddressList,
439-
whoCanLeaveGroup: rest.whoCanLeaveGroup,
440-
whoCanContactOwner: rest.whoCanContactOwner,
441-
favoriteRepliesOnTop: rest.favoriteRepliesOnTop,
442-
whoCanApproveMembers: rest.whoCanApproveMembers,
443-
whoCanBanUsers: rest.whoCanBanUsers,
444-
whoCanModerateMembers: rest.whoCanModerateMembers,
445-
whoCanModerateContent: rest.whoCanModerateContent,
446-
whoCanAssistContent: rest.whoCanAssistContent,
447-
enableCollaborativeInbox: rest.enableCollaborativeInbox,
448-
whoCanDiscoverGroup: rest.whoCanDiscoverGroup,
449-
defaultSender: rest.defaultSender,
450418
}
451419
default:
452420
return { oauthCredential, ...rest }

apps/sim/tools/google_maps/pollen.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ export const googleMapsPollenTool: ToolConfig<GoogleMapsPollenParams, GoogleMaps
9090
const url = new URL('https://pollen.googleapis.com/v1/forecast:lookup')
9191
url.searchParams.set('location.latitude', params.lat.toString())
9292
url.searchParams.set('location.longitude', params.lng.toString())
93-
const days = typeof params.days === 'number' && Number.isFinite(params.days) ? params.days : 1
93+
const rawDays =
94+
typeof params.days === 'number' && Number.isFinite(params.days)
95+
? Math.trunc(params.days)
96+
: 1
97+
const days = Math.min(Math.max(rawDays, 1), 5)
9498
url.searchParams.set('days', days.toString())
9599
if (params.languageCode) {
96100
url.searchParams.set('languageCode', params.languageCode.trim())

0 commit comments

Comments
 (0)