Skip to content

fix(hex,stripe): validate Hex and Stripe against their API docs - #10005

Merged
waleedlatif1 merged 6 commits into
stagingfrom
validate/hex-stripe
Nov 13, 2026
Merged

waleedlatif1 merged 6 commits into
stagingfrom
validate/hex-stripe

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Validated Hex and Stripe against their API docs (Hex OpenAPI spec, Stripe API reference) and fixed the gaps. Changes are additive or fix requests that were already invalid or misleading, with one deliberate exception: a blank Stripe Unit Amount used to create a $0 price and now returns Stripe's validation error.

Hex

  • Get Project Runs no longer receives the List Projects status filter (PUBLISHED/DRAFT is never a valid run status). The list users/groups/collections/data connections operations drop any stored List Projects sort field they don't accept; accepted values still pass.
  • Get Queried Tables gains after/before cursors and outputs; List Groups gains the documented userId filter. Both read dedicated subBlocks.
  • Runs expose runTrigger. elapsedTime is documented as milliseconds. Limit ranges are corrected, and Create Group's createdAt is optional (the endpoint doesn't return it).
  • Path ids go through safeUrlPathSegment.

Stripe

  • The seven Yes/No dropdowns (cancel at period end, auto advance, capture, active, prorate, invoice now, paid out of band) now start on "Default", which sends nothing. Before, the first option ("Yes") was saved as soon as the field rendered. Stored Yes/No values send exactly what they did before. A boolean true from an agent or the API is no longer read as false.
  • Update Subscription sends items[i][id], so changing an item's price updates that item instead of adding a duplicate, as Stripe documents. It sends deleted only when it is true.
  • Create Price no longer sends unit_amount=0 for an empty field. Create Subscription no longer sends trial_period_days=0.
  • Every list and search operation now supports starting_after/ending_before or page/next_page.
  • Ids go through safeUrlPathSegment.
  • The trigger declares the documented account and context event fields.

Agent tool calls: when a call comes from an agent (the mapper receives a context), cursors and filters the model passes under the tool param names are kept. Canvas runs still read the dedicated fields, so stale values from other operations stay out.

Type of Change

  • Bug fix

Testing

  • New regression tests: blocks/blocks/hex.test.ts and blocks/blocks/stripe.test.ts. Each case was checked to fail on the pre-fix mapper.
  • Also ran tools/stripe, lib/webhooks/providers/stripe.test.ts and blocks/blocks.test.ts; all pass.
  • check-block-registry origin/staging, check:utils, check:test-patterns, check:explicit-any, check:tool-metadata and check:docs pass.

Checklist

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

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 13, 2026 8:45pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

This PR corrects Hex and Stripe request fields and adds pagination.

  • Hex requests use the filters and cursors for their selected operation.
  • Hex results describe the run and project fields the API returns.
  • Hex resource IDs stay within their request path segment.
  • Stripe lists and searches can fetch results a page at a time.
  • Stripe leaves default and blank optional fields out of requests.
  • Stripe subscription updates identify the item they change.
  • Stripe resource IDs stay within their request path segment.
  • Stripe webhook results include the documented account and context fields.

Both earlier, unnumbered findings are addressed: zero quantities are sent, and Hex run outputs declare string versions. No new actionable issue was found.

Reviews (3) · Last reviewed commit: "fix(hex): only fall back to raw run stat..." · Reviewed by Greptile

Comment thread apps/sim/tools/hex/types.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 76 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/tools/hex/get_project_runs.ts Resolved
Comment thread apps/sim/tools/hex/types.ts Resolved
Comment thread apps/sim/triggers/stripe/webhook.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 76 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/blocks/blocks/hex.ts Resolved
Comment thread apps/sim/blocks/blocks/hex.ts Resolved
…nted run trigger and pagination fields

- get_project_runs no longer receives the List Projects status filter, and list
  users/groups/collections/data connections drop a stored List Projects sort
  field they reject (valid ones still pass)
- get_queried_tables gains after/before cursors via dedicated subBlocks, plus
  after/before outputs
- list_groups gains the documented userId filter via a dedicated subBlock
- run status and project runs expose runTrigger; elapsedTime is milliseconds
- path ids go through safeUrlPathSegment
- correct documented limit ranges and the create_group createdAt output
…onor subscription item ids, guard path ids, add pagination

- Yes/No dropdowns (cancel_at_period_end, auto_advance, capture, active, prorate,
  invoice_now, paid_out_of_band) gain a leading Default option that is never sent.
  The UI seeded the first option ("Yes") as soon as advanced options were shown, so
  merely opening them on Update Subscription scheduled a cancellation and on Pay
  Invoice marked the invoice paid out of band. Stored 'true'/'false'/null map exactly
  as before, and every key is now assigned so a raw '' cannot leak past the mapper.
- update_subscription sends items[i][id] (and deleted when true): Stripe adds a new
  item when id is omitted, so changing a price created a duplicate billed item.
- All path ids go through safeUrlPathSegment, so an id cannot traverse to another
  Stripe endpoint with the caller's key.
- create_price no longer sends unit_amount=0 for an empty field; create_subscription
  no longer sends trial_period_days=0 for an empty field.
- starting_after/ending_before on every list tool and page/next_page on every search
  tool, wired through new list_starting_after/list_ending_before/search_page subBlocks.
- Stripe trigger declares the documented account and context event fields.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 76 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was successfully deployed

1 active deployment
Preview — b1e748f9 Deployed Nov 13, 2026 by vercel[bot]
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