Uh oh!
There was an error while loading. Please reload this page.
improvement(billing): duplicate checks for bypasses, logger billing actor consistency, run from block - #3107
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR strengthens billing integrity by adding duplicate subscription checks, ensuring billing actor consistency, and extending billing enforcement to run-from-block executions. Key Changes
Architecture ImpactThe changes consolidate billing logic into reusable helpers and ensure consistent billing actor resolution across execution paths. The duplicate subscription checks create multiple defense layers at authorization, checkout, transfer, and organization creation points. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ExecuteAPI as Execute-from-Block API
participant Preprocessing as preprocessExecution
participant Billing as Billing Module
participant Logger as ExecutionLogger
participant DB as Database
Client->>ExecuteAPI: POST /workflows/{id}/execute-from-block
ExecuteAPI->>Preprocessing: Check billing & limits
Preprocessing->>DB: Fetch workflow record
DB-->>Preprocessing: Workflow details
Preprocessing->>Billing: Get workspace billed account
Billing-->>Preprocessing: actorUserId
Preprocessing->>Billing: Check usage limits
Billing-->>Preprocessing: Usage check result
alt Usage exceeded or blocked
Preprocessing-->>ExecuteAPI: Error (402/403)
ExecuteAPI-->>Client: Execution blocked
else Checks passed
Preprocessing-->>ExecuteAPI: Success with actorUserId
ExecuteAPI->>ExecuteAPI: Execute workflow
ExecuteAPI->>Logger: Log execution with costs
Logger->>Billing: Get workspace billed account
Billing-->>Logger: billingUserId
Logger->>DB: Update userStats (billing actor)
DB-->>Logger: Updated
Logger-->>ExecuteAPI: Logged
ExecuteAPI-->>Client: Execution result
end
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
icecrasher321
commented
Feb 2, 2026
@cursor review |
Uh oh!
There was an error while loading. Please reload this page.
icecrasher321
commented
Feb 2, 2026
@cursor review |
Uh oh!
There was an error while loading. Please reload this page.
icecrasher321
commented
Feb 2, 2026
@cursor review |
Uh oh!
There was an error while loading. Please reload this page.
…ctor consistency, run from block (simstudioai#3107) * improvement(billing): improve against direct subscription creation bypasses * more usage of block/unblock helpers * address bugbot comments * fail closed * only run dup check for orgs
Summary
Type of Change
Testing
Tested manually
Checklist