Concurrency & quota

The shared session pool, scheduling by priority, and how Plan parks on token-limit windows and auto-resumes — staying on your subscription.

Two things govern how fast — and how safely — a bulk run goes: the concurrency pool and the quota auto-resume.

The global pool

A single global pool caps how many agent sessions run at once, across all campaigns. Why global? Because your subscription quota is shared — there’s no point running more sessions than your plan can feed. The pool is the headline lever on wall-clock time:

  • small pool → slower, gentler on the quota;
  • large pool → faster, but you hit the cap sooner, then everyone waits for the same reset.

Set it from the engine strip (the Pool field). Each campaign also has its own max_sessions cap (≤ the global pool). Parked sessions don’t count against the pool.

Scheduling

Work is dispatched by campaign priority, with anti-starvation so a low-priority campaign still makes progress. The engine runs as a periodic pass on OFM’s single heartbeat — no extra thread, no external cron.

Quota: the headline behavior

In bulk on a subscription, hitting the token limit is the normal state, not an error. Plan treats it as a scheduled pause:

  1. It detects the CLI’s “usage limit / resets at HH:MM” screen (per-provider).
  2. The session is parkednot quarantined: its unit stays “to do”, attempts is not incremented, and the slot is freed for other work.
  3. The resume time is persisted (so it survives a reboot during the wait).
  4. When the window reopens, the session is relaunched and the unit re-run automatically, with a little jitter so all parked workers don’t wake at the same millisecond.

If the reset time can’t be parsed, Plan falls back to a backoff retry. Either way it auto-resumes — it never spills onto the metered API (why).

The three gaps, recapped

Plan is a continuity engine that bridges crash (relaunch via lease), reboot (resume from the on-disk spool) and quota (park + auto-resume). That’s what lets a multi-day batch finish without you watching it.

Strategy

You can bias toward rush (run flat-out, then sleep on the cap) or spread (pace work across the quota window). Pick what fits the deadline and how much of your plan you want to spend at once.