Repository navigation
Description
In adaptive routing (#79102), a suspension covers every effort of its base model (contract 1), so suspending github-copilot/model-a@low blocks github-copilot/model-a@high as well. However, recordOutcome in actions/setup/js/routing_history.cjs currently checks only pair.suspended on the exact pair that ran.
If github-copilot/model-a@low is suspended and later disappears from the router's eligible rank while github-copilot/model-a@high remains eligible, AWF's companion sibling-effort probe recovery schedules the due probe on the highest-ranked eligible sibling effort (github-copilot/model-a@high). Without matching settlement in routing_history.cjs, a completed sibling probe records a normal outcome on model-a@high and leaves model-a@low's suspended object untouched. Because refresh() never evicts suspended pairs or expires suspended past 60 days, the github-copilot/model-a base remains blocked from normal selection on every subsequent run while the original effort stays absent from the rank, until a workflow edit or manual gh aw routing reset.
For example, suppose a workflow records this sequence:
github-copilot/model-a@lowfails 3 times in a row and is suspended atseq = 7(suspended: {"since_seq": 7, "pending": 3}).github-copilot/model-b@highsucceeds atseq = 8(last_success_seq = 8), making the probe due.github-copilot/model-a@lowleaves the catalogue, so AWF probesgithub-copilot/model-a@high, which succeeds atseq = 9.
State after model-a@high probe succeeds |
Current behavior | Intended behavior |
|---|---|---|
model-a@low.suspended |
{"since_seq": 7, "pending": 3} |
null |
model-a@low.history |
Keeps the 3 pending failures | Pending failures removed ([]) |
model-a@low.streak |
3 |
0 |
model-a@high.history |
Records [9, ..., true, ...] |
Records [9, ..., true, ...] |
github-copilot/model-a on next run |
Still blocked while model-a@low is absent |
Unblocked and eligible |
Intended behavior in actions/setup/js/routing_history.cjs (recordOutcome):
- If the pair that ran is itself suspended, preserve the exact current behavior.
- Otherwise, check whether any sibling pair in the same scope with the same base model (the prefix before
@) has a non-nullsuspendedrecord:- On success: settle every suspended sibling of that base as restored by removing each sibling's
pendingtrailing failures (bounded by its history length) and clearing itssuspendedandstreak, then record the probe pair's success entry withstreakset to 0, advancescope.last_success_seq, and emit abackevent for the probe pair. - On failure when
scope.last_success_seq > sibling.suspended.since_seq: settle every due suspended sibling as confirmed broken by keeping only itspendingtrailing failures and clearing itssuspendedandstreak, then record the probe pair's failure entry and reset itsstreakto 0, and emit abrokenevent for the probe pair. - On failure when no model has succeeded since the base's suspension (
scope.last_success_seq <= since_seqfor every suspended sibling): do not count the failure and emitnote: "awaiting_success", matching exact-pair behavior.
- On success: settle every suspended sibling of that base as restored by removing each sibling's
Validation and docs:
- Sync the
sibling-probe-restores,sibling-probe-confirms-break, andsibling-probe-awaiting-successoracle vectors inactions/setup/js/fixtures/routing-history/aw2-reducer.json, and add targeted reducer unit tests inactions/setup/js/routing_history.test.cjscovering prior successes on the suspended sibling, settlement events, mixed due and non-due siblings, and cross-provider/prefix isolation. - Document sibling-effort suspension settlement under contract 5 in
adaptive-routing/issues/contracts.md.
Activity