Skip to content

improvement(loops): validate loops integration and update skill files#3384

Merged
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/validate-loops
Feb 28, 2026
Merged

improvement(loops): validate loops integration and update skill files#3384
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/validate-loops

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add .trim() to all string params across loops tools to prevent whitespace issues
  • Add "Return ONLY the JSON" instructions to AI-generated field descriptions in block config
  • Add default values for property type and filter dropdowns
  • Expand output descriptions with actual field names for better discoverability

Type of Change

  • Improvement (non-breaking enhancement)

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 28, 2026 8:39pm

Request Review

@waleedlatif1 waleedlatif1 merged commit 9be75e3 into staging Feb 28, 2026
5 of 6 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/validate-loops branch February 28, 2026 20:37
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 28, 2026

Greptile Summary

Enhanced the Loops integration with input sanitization and improved UX. Added .trim() to all string parameters across loops tools to prevent whitespace issues, enhanced AI prompt instructions with "Return ONLY the JSON" directives, set sensible defaults for dropdown fields, and expanded output descriptions with actual field names for better discoverability.

  • Added .trim() to string params in all loops tool files (email, userId, firstName, lastName, source, userGroup, transactionalId)
  • Enhanced AI-generated field descriptions with explicit JSON-only instructions to prevent LLM verbosity
  • Added default values: propertyType defaults to 'string', propertyFilter defaults to 'all'
  • Expanded output descriptions with actual field names (contacts, mailingLists, transactionalEmails, pagination, properties)
  • Issue found: eventName parameter in send_event.ts is missing .trim() call, inconsistent with other string parameters

Confidence Score: 4/5

  • Safe to merge after fixing the missing .trim() on eventName parameter
  • The changes are well-structured and improve input validation and UX. However, there's one inconsistency where eventName is not trimmed while all other string parameters are, which could lead to unexpected behavior with whitespace in event names
  • Pay close attention to apps/sim/tools/loops/send_event.ts - the eventName parameter needs .trim() added for consistency

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/loops.ts Added AI prompt instructions, default dropdown values, and expanded output descriptions with field names
apps/sim/tools/loops/create_contact.ts Added .trim() to email, firstName, lastName, source, userGroup, and userId parameters
apps/sim/tools/loops/send_event.ts Added .trim() to email and userId, but missing .trim() on eventName parameter
apps/sim/tools/loops/update_contact.ts Added .trim() to email, userId, firstName, lastName, source, and userGroup parameters

Last reviewed commit: f94b143

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@@ -64,8 +64,8 @@ export const loopsSendEventTool: ToolConfig<LoopsSendEventParams, LoopsSendEvent
eventName: params.eventName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventName should be trimmed for consistency with other string params

Suggested change
eventName: params.eventName,
eventName: params.eventName.trim(),

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant