Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • fixed optional params for firecrawl, updated docs

Type of Change

  • Bug fix

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 Dec 12, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Dec 12, 2025 4:38am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 12, 2025

Greptile Overview

Greptile Summary

This PR attempts to fix optional parameter handling in Firecrawl tools by changing checks from !== undefined to != null, and includes documentation updates and minor refactoring.

Main Changes:

  • Updated optional parameter checks in firecrawl tools (scrape.ts, crawl.ts, map.ts, search.ts) from !== undefined to != null
  • Improved output path generation logic in tag-dropdown.tsx to avoid adding parent paths when nested properties exist
  • Updated documentation for various tool integrations (Asana, Confluence, Google Groups, Google Vault, HubSpot, Pipedrive, Typeform, SQS)
  • Reorganized SQS icon placement and mapping alphabetically

Critical Issues:

  • The optional parameter fix is incomplete - the issue identified in previous comments still exists. Using != null checks will still fail when numeric parameters are set to valid 0 values (e.g., maxAge: 0, waitFor: 0, timeout: 0, delay: 0, maxConcurrency: 0, limit: 0), as 0 is falsy in JavaScript
  • This affects scrape.ts (lines 48, 50, 54), crawl.ts (lines 68-69), map.ts (lines 86-87), and search.ts (lines 38, 44)

Recommended Fix:
For numeric parameters that can validly be 0, use explicit checks: params.maxAge !== undefined or typeof params.maxAge === 'number'

Confidence Score: 2/5

  • This PR has critical unresolved bugs in parameter validation that will cause runtime failures
  • The core issue from previous reviews remains unresolved - numeric parameters with valid 0 values will be silently dropped from API requests, causing incorrect behavior. While the PR title claims to fix optional params, the fix is incomplete and the same logical bug persists across multiple firecrawl tool files.
  • All firecrawl tool files require immediate attention: apps/sim/tools/firecrawl/scrape.ts, apps/sim/tools/firecrawl/crawl.ts, apps/sim/tools/firecrawl/map.ts, and apps/sim/tools/firecrawl/search.ts

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/tools/firecrawl/scrape.ts 2/5 Changed optional param checks from !== undefined to != null, but still fails for valid 0 values on numeric params like maxAge, waitFor, and timeout
apps/sim/tools/firecrawl/crawl.ts 2/5 Changed optional param checks from !== undefined to != null, but still fails when delay or maxConcurrency is 0
apps/sim/tools/firecrawl/map.ts 2/5 Changed optional param checks from !== undefined to != null, but still fails when limit or timeout is 0
apps/sim/tools/firecrawl/search.ts 2/5 Changed optional param checks from !== undefined to != null, but still fails when limit or timeout is 0

Sequence Diagram

sequenceDiagram
    participant User
    participant FirecrawlTool as Firecrawl Tool
    participant API as Firecrawl API
    
    User->>FirecrawlTool: Call with params (url, maxAge=0, etc.)
    FirecrawlTool->>FirecrawlTool: Build request body
    Note over FirecrawlTool: Check params with != null<br/>Issue: 0 values treated as falsy
    FirecrawlTool->>API: POST /v2/scrape (missing 0 values)
    API-->>FirecrawlTool: Response
    FirecrawlTool-->>User: Transformed output
Loading

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.

15 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

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.

23 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit c4fd39d into staging Dec 12, 2025
4 of 5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/to branch December 12, 2025 04:39
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.

2 participants