v0.6.43: mothership billing idempotency, env var resolution fixes #4165
v0.6.43: mothership billing idempotency, env var resolution fixes #4165waleedlatif1 merged 4 commits intomainfrom
Conversation
* fix(billing): add idempotency to billing * Only release redis lock if billed
* fix(triggers): env var resolution in provider configs * throw on errored resolution
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Fixes webhook trigger executions to resolve Reviewed by Cursor Bugbot for commit 7529a75. Configure here. |
Greptile SummaryThis PR adds idempotency to the billing Confidence Score: 5/5Safe to merge — all changes are correct, well-tested, and follow project conventions with no blocking issues. Both features are implemented correctly. The billing idempotency uses the atomic claim/release pattern properly: pre-commit failures release the key so the caller can retry, post-commit failures retain it to prevent double-billing, and duplicates within the 1-hour TTL receive 409. The env-resolver functions are clean, type-safe, and covered by tests. No P0 or P1 findings. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Route as update-cost route
participant Idempotency as billingIdempotency
participant DB as recordUsage / DB
Caller->>Route: POST /api/billing/update-cost (idempotencyKey?)
Route->>Idempotency: atomicallyClaim('update-cost', key)
alt key already exists
Idempotency-->>Route: claimed=false
Route-->>Caller: 409 Duplicate request
else first time
Idempotency-->>Route: claimed=true (in-progress stored)
Route->>DB: recordUsage(...)
alt recordUsage succeeds
DB-->>Route: ok (usageCommitted=true)
Route->>DB: checkAndBillOverageThreshold(...)
alt threshold check succeeds
Route-->>Caller: 200 success (key stays in-progress until TTL)
else threshold check fails
Route->>Idempotency: retain claim (prevent double-billing)
Route-->>Caller: 500 error
end
else recordUsage fails
Route->>Idempotency: release(normalizedKey) — retry allowed
Route-->>Caller: 500 error
end
end
Reviews (1): Last reviewed commit: "fix(triggers): env var resolution in pro..." | Re-trigger Greptile |
…API docs (#4161) * fix(google-drive): add auto export format and Azure storage debug logging * chore: remove Azure storage debug logging * fix(google-drive): use status-based fallback instead of string matching for export errors * fix(google-drive): validate export formats against Drive API docs, remove fallback * fix(google-drive): use value function for dropdown default * fix(google-drive): add text/markdown to valid export formats for Google Docs * fix(google-drive): correct ODS MIME type for Sheets export format
) * fix(security): resolve ReDoS vulnerability in function execute tag pattern Simplified regex to eliminate overlapping quantifiers that caused exponential backtracking on malformed input without closing delimiter. * feat(jira): support raw ADF document objects in description and environment fields Add toAdf() helper that passes through ADF objects as-is or wraps plain text in a single-paragraph ADF doc. Update write and update routes to use it, replacing inline ADF wrapping. Update Zod schema to accept string or object for description. Fully backward compatible — plain text still works, but callers can now pass rich ADF with expand nodes, tables, code blocks, etc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(jira): handle partial ADF nodes and non-ADF objects in toAdf() Wrap partial ADF nodes (type + content but not doc) in a doc envelope. Fall back to JSON.stringify for non-ADF objects instead of String() which produces [object Object]. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * lint * fix(jira): handle JSON-stringified ADF in toAdf() for variable resolution The executor's formatValueForBlock() JSON.stringify's object values when resolving <Block.output> references. This means an ADF object from an upstream Agent block arrives at the route as a JSON string. toAdf() now detects JSON strings containing valid ADF documents or nodes and parses them back, ensuring rich formatting is preserved through the pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * lint changes * fix(jira): update environment Zod schema to accept ADF objects Match the description field schema change — environment also passes through toAdf() so its Zod schema must accept objects too. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * updated lobkc --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.