feat(plaid): add the Plaid bank-data integration - #6749
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview Shared block helpers A Docs-only churn from regeneration: Ashby webhook docs add Temporary as an employment type; a few integration pages get trivial Reviewed by Cursor Bugbot for commit 410d6f9. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryAdds a complete Plaid bank-data integration with ten tools, block and catalog registration, response normalization, error extraction, documentation, and tests. It also centralizes optional numeric and boolean block coercion shared with Brex.
Confidence Score: 4/5The PR appears safe to merge, with only a non-blocking TypeScript const-assertion issue in the Plaid block configuration. The Plaid operation IDs, registry entries, credential visibility, request mappings, and response transforms are consistently wired; the accepted concern only weakens compile-time typing for two operation lists. Files Needing Attention: apps/sim/blocks/blocks/plaid.ts
|
| Filename | Overview |
|---|---|
| apps/sim/blocks/blocks/plaid.ts | Defines the Plaid block, conditional fields, operation dispatch, templates, and skills; the two operation constants omit required const assertions. |
| apps/sim/tools/plaid/utils.ts | Provides environment selection, credential headers, wire-value normalization, and response mappers for shared Plaid behavior. |
| apps/sim/tools/plaid/sync_transactions.ts | Implements cursor-based transaction synchronization with optional request controls and normalized pagination output. |
| apps/sim/tools/plaid/get_auth.ts | Implements retrieval and normalization of ACH, EFT, BACS, and international account identifiers. |
| apps/sim/tools/error-extractors.ts | Adds extraction of Plaid developer messages and error codes from Plaid error envelopes. |
| apps/sim/tools/registry.ts | Registers all ten Plaid tools consistently with their block operation identifiers. |
| apps/sim/blocks/utils.ts | Centralizes optional finite-number and boolean coercion for Plaid and Brex block execution. |
Sequence Diagram
sequenceDiagram
participant User as Workflow or Agent
participant Block as Plaid Block
participant Tool as Selected Plaid Tool
participant API as Plaid API
User->>Block: Operation and inputs
Block->>Block: Select tool and coerce optionals
Block->>Tool: Credentials and operation parameters
Tool->>API: Environment-specific HTTPS request
API-->>Tool: Plaid response or error envelope
Tool->>Tool: Normalize response or extract error
Tool-->>User: Typed workflow output
Reviews (1): Last reviewed commit: "feat(plaid): add the Plaid bank-data int..." | Re-trigger Greptile
| const ACCESS_TOKEN_OPERATIONS = [ | ||
| 'sync_transactions', | ||
| 'get_accounts', | ||
| 'get_balances', | ||
| 'get_identity', | ||
| 'get_auth', | ||
| 'get_item', | ||
| ] | ||
|
|
||
| const ACCOUNT_FILTER_OPERATIONS = ['get_accounts', 'get_balances', 'get_identity', 'get_auth'] |
There was a problem hiding this comment.
Const operation arrays are widened
These operation groups directly control conditional visibility and required fields, but without const assertions their identifiers widen to string[], weakening compile-time protection against invalid operation values.
| const ACCESS_TOKEN_OPERATIONS = [ | |
| 'sync_transactions', | |
| 'get_accounts', | |
| 'get_balances', | |
| 'get_identity', | |
| 'get_auth', | |
| 'get_item', | |
| ] | |
| const ACCOUNT_FILTER_OPERATIONS = ['get_accounts', 'get_balances', 'get_identity', 'get_auth'] | |
| const ACCESS_TOKEN_OPERATIONS = [ | |
| 'sync_transactions', | |
| 'get_accounts', | |
| 'get_balances', | |
| 'get_identity', | |
| 'get_auth', | |
| 'get_item', | |
| ] as const | |
| const ACCOUNT_FILTER_OPERATIONS = [ | |
| 'get_accounts', | |
| 'get_balances', | |
| 'get_identity', | |
| 'get_auth', | |
| ] as const |
Context Used: TypeScript conventions and type safety (source)
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!
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 410d6f9. Configure here.
| { label: 'Sandbox', id: 'sandbox' }, | ||
| ], | ||
| value: () => 'production', | ||
| condition: { field: 'operation', value: 'create_sandbox_public_token', not: true }, |
There was a problem hiding this comment.
Sandbox flow defaults to production
Medium Severity
create_sandbox_public_token always calls the sandbox host while hiding environment, but that field still defaults to production for every other operation including exchange_public_token. The natural create-then-exchange sandbox path therefore hits production with a sandbox public token and fails with an environment mismatch until environment is manually flipped.
Reviewed by Cursor Bugbot for commit 410d6f9. Configure here.


Summary
tools/plaid/— transactions sync (cursor-based), accounts, real-time balances, identity, ACH/EFT/BACS/IBAN auth numbers, item health, institution search/get, public-token exchange, and a sandbox token creatorplaid-errorsextractor so failures surface as Plaid'serror_message (ERROR_CODE)instead of a generic HTTP errorblocks/utils.ts(brex and plaid now share one implementation)Known follow-up (not in this PR):
get_auth/get_identityoutputs persist to execution logs unredacted for workspaces without a PII redaction policy — same pre-existing gap as Brex cash accounts and Rippling worker data. The right fix is a tool-declared entity hook into the staged PII redaction pipeline (US_BANK_NUMBERandIBAN_CODEare already supported entity types).Type of Change
Testing
Checklist