Automatic managed-ledger offload triggers create redundant retry work Coalesce automatic…
- User
Automatic managed-ledger offload triggers create redundant retry work
Coalesce automatic offload triggers while an automatic offload is running. There must be at most one active automatic run and at most one follow-up run when additional triggers arrive. A follow-up must still process newly eligible ledgers, and explicit/manual offload futures must retain their existing behavior.
Interface
No new public interfaces are introduced.
- Assistant
I’ll trace the managed-ledger offload trigger path and its concurrency tests, then implement the coalescing narrowly so manual futures remain untouched.
- Assistant
rgisn’t installed in this checkout, so I’m switching to scopedgrep/findsearches and keeping the investigation within the relevant modules. - Assistant
The retry amplification comes from each automatic trigger independently polling the shared offload lock every 100 ms. I’m replacing that with per-ledger automatic-run state: triggers during a run share one pending follow-up, whose eligibility is recalculated after the active run completes. The manual API will continue to fail immediately with
OffloadInProgressExceptionwhen the lock is held. - Assistant
The implementation now forwards every supplied automatic future to the run it was coalesced into, while the shared offload lock semantics for manual requests are unchanged. Compilation is underway; after that I’ll run the focused offload tests, including the existing concurrent-trigger cases.
- Assistant
The focused concurrency tests pass across their data-provider variants. I also tightened the coalescing state so repeated internal rollover triggers don’t accumulate references to the shared already-completed sentinel future; they only set the single follow-up marker.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.