fix: honor specific-tier fallbacks in proxy path#1587
Merged
SebConejo merged 1 commit intomnfst:mainfrom Apr 17, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1587 +/- ##
=======================================
Coverage 97.92% 97.92%
=======================================
Files 118 118
Lines 8675 8675
Branches 3265 3265
=======================================
Hits 8495 8495
Misses 178 178
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fallback_modelsfrom specificity resolutionWhy
Specific-tier fallbacks were persisted and configurable, but the runtime proxy path ignored them and only consulted general tier fallbacks.
What changed
packages/backend/src/routing/dto/resolve-response.tsfallback_models?: string[] | nullpackages/backend/src/routing/resolve/resolve.service.tsassignment.fallback_models ?? nullinresolveSpecificity(...)packages/backend/src/routing/proxy/proxy.service.tsresolved.fallback_modelsbefore general tier fallbackspackages/backend/src/routing/resolve.service.spec.tspackages/backend/src/routing/proxy/__tests__/proxy.service.spec.tsTest plan
npm run build --workspace=packages/sharednpm test --workspace=packages/backend -- --runInBand src/routing/resolve.service.spec.ts src/routing/proxy/__tests__/proxy.service.spec.tsAdditional note
To run the targeted tests in this environment, I also had to fix a pre-existing strict-typing compile issue in
packages/backend/src/routing/routing-core/tier.service.tsby annotating theTIERS.map(...)callback parameter asTier. If you'd prefer, I can split that into a separate cleanup PR.Closes #1586
Summary by cubic
Ensure specificity-routed requests use their own fallback chain when the primary model fails. Propagates per-assignment
fallback_modelsthrough resolve and prefers them in the proxy, fixing incorrect tier fallback behavior.fallback_modelsonResolveResponseand propagate fromresolveSpecificity.resolved.fallback_modelsbefore tier-level fallbacks.tier.service.ts(TIERS.mapcallback typed asTier).Written for commit 4f91ccd. Summary will update on new commits.