Skip to content

[P0][Plan 2] SF-006 — Replace destination burst with bounded generation concurrency #27

Description

@Ankit6149

Confirmed problem

After strategy generation, all selected destinations launch together with Promise.all. With twelve destinations and one revision attempt per channel, a campaign can create up to 25 provider requests in a concentrated burst, risking rate limits, high cost, inconsistent latency, and serverless timeout failure.

Scope

  • Split destination generation into independent requests.
  • Add a client/server generation queue with a default concurrency of two.
  • Support provider-specific and local-model concurrency limits.
  • Give long-form destinations a separate lane or scheduling policy.
  • Add cancellation through campaign-level and request-level abort controllers.
  • Record request count, duration, retries, provider/model, and destination status.

Acceptance criteria

  • No campaign launches all destination requests simultaneously.
  • Queue progress is visible and updates as each destination starts/completes.
  • One destination failure does not cancel unrelated destinations.
  • Cancel stops queued work and aborts active work safely.
  • Rate-limit/payment errors are not automatically retried.
  • A full twelve-destination run respects the configured concurrency ceiling.

Required verification

  • Concurrency tests measuring maximum simultaneous calls.
  • Partial failure, cancellation, timeout, and long-form tests.
  • Provider capability tests for hosted and local routes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions