Skip to content

[pull] main from firecrawl:main#321

Merged
pull[bot] merged 1 commit into
innFactory:mainfrom
firecrawl:main
Jul 17, 2026
Merged

[pull] main from firecrawl:main#321
pull[bot] merged 1 commit into
innFactory:mainfrom
firecrawl:main

Conversation

@pull

@pull pull Bot commented Jul 17, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* refactor(api): confirm Exchange billing from the billing worker

The billing confirmation moves from an awaited call in the scrape
worker to the billing pipeline, so confirmed means the debit actually
committed:

- billScrapeJob attaches the access event id to the bill_team job and
  no longer awaits anything Exchange-related
- the billing worker threads it into the batch operation with the
  billing job id as the reference
- the batch processor confirms each covered access once the group's
  debit commits, and voids it when the commit fails or refunds
- outcome reporting rides the billing pipeline's retries and never
  throws, so it cannot affect billing itself

The scrape worker's failure-path void can now race the async confirm;
the Exchange resolves this authoritatively (void -> confirmed is a
legal repair, confirmed -> void stays rejected), so a paid access can
never end up voided.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(exchange): never void on ambiguous commits, retry outcome reports

- Failed or thrown billing commits no longer void the Exchange access
  event: supaBillTeam maps transport errors to success: false, and the
  debit may have committed before the error, so voiding could erase a
  real debit. The event stays pending for reconciliation.
- Confirmation delivery moved outside the batch lock so an Exchange
  outage can never hold the 30s lease past expiry and overlap another
  batch run.
- reportExchangeBilling now retries transient failures (3 attempts,
  backoff), treats 4xx as definitive, and returns success.
- Billing-queue enqueue failure now voids the access event (the debit
  can never commit; a lost-ack enqueue is repaired by void -> confirmed).
- Index-worker guards against an empty-string access event ID.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(exchange): jittered backoff, bounded confirm concurrency, retryable 429

- Retry backoff gains full jitter (capped at 15s) so a batch of reports
  failing together does not retry in synchronized bursts against a
  degraded Exchange.
- Batch confirmations run at most 16 at a time instead of one
  unbounded Promise.all over the whole batch.
- 429 is treated as transient (honoring Retry-After when sane) instead
  of a definitive rejection, so rate-limited confirmations reconcile
  once the limit expires.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(exchange): worker-level confirm semaphore, HTTP-date Retry-After, true full jitter

- The 16-slot confirmation concurrency budget is now shared across the
  worker via a small semaphore, so overlapping post-lock deliveries
  cannot stack beyond the bound.
- Retry-After parsing accepts the HTTP-date form in addition to
  delta-seconds.
- The retry delay is now genuine full jitter (0..backoff) with
  Retry-After as the lower bound, matching the comment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(exchange): pull-based confirm worker pool

Confirmation delivery now uses a small worker pool that pulls
operations one at a time, so a slow Exchange queues at most 16 waiters
per batch on the shared budget instead of one closure per operation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Jul 17, 2026
@pull pull Bot added the ⤵️ pull label Jul 17, 2026
@pull
pull Bot merged commit 16d5e39 into innFactory:main Jul 17, 2026
2 of 9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant