mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-26 00:52:18 +03:00
selectQuotaShareTarget reserves an in-flight slot for its winner but no
production caller ever invoked the returned release callback, so counters
grew monotonically for the process lifetime: P2C degenerated into
'fewest lifetime dispatches' and the max_concurrent gate fail-opened
past its cap permanently.
Thread the idempotent release out of the ordering path:
- applyStrategyOrdering now returns { orderedTargets, quotaShareRelease }
(non-null only for the quota-share strategy)
- resolveComboTargetPipeline releases it when a post-selection hard filter
produces an earlyResponse and otherwise hands it to the host
- handleComboChatInner invokes it in the dispatch finally and on the two
early returns between resolution and the try block
Regression tests pin the missing case from the issue: ordering through
the real path leaves the counter back at zero, plus null-release for
non-quota-share strategies.