fix(router): decision call skips settled requests and ignores client cancels

Live mode no longer calls the decision model when a floor or keyword rule already fixes the tier. A client cancel during the call no longer counts toward the breaker.
This commit is contained in:
2026-11-25 14:15:20 +00:00
parent 8c01f15ee5
commit 2cd828c162
4 changed files with 53 additions and 2 deletions
+2 -1
View File
@@ -563,7 +563,8 @@ func classifySmartV2With(rt *smartRouter, req map[string]any, endpoint string, f
rank, reason, next = smartSessionRoute(&rt.session, top, f, sc.sess, verdict, sc.now, askHash)
out.hardRank = smartMaxInt(out.hardRank, next.pin)
}
if assist != nil && reason == smartReasonScore && f.found && smartNearBoundary(rt, verdict.score) {
if assist != nil && reason == smartReasonScore && f.found && smartNearBoundary(rt, verdict.score) &&
(!rt.decision.live || smartMaxInt(floorRank, kwRank) < smartMinInt(rank+1, top)) {
ans := assist(f)
newRank, outcome := applyDecision(rt, rank, ans)
out.heuristicRank, out.decisionOutcome = rank, outcome