feat(core): enhance availability routing with wrapped fallback and single-model policies (#13874)

This commit is contained in:
Adam Weidman
2025-12-01 12:41:06 -08:00
committed by GitHub
parent 806cd112ac
commit b4df7e351b
5 changed files with 65 additions and 24 deletions
@@ -22,6 +22,7 @@ describe('policyHelpers', () => {
isInFallbackMode: () => false,
} as unknown as Config;
const chain = resolvePolicyChain(config);
expect(chain).toHaveLength(1);
expect(chain[0]?.model).toBe('custom-model');
});
@@ -46,7 +47,7 @@ describe('policyHelpers', () => {
];
const context = buildFallbackPolicyContext(chain, 'b');
expect(context.failedPolicy?.model).toBe('b');
expect(context.candidates.map((p) => p.model)).toEqual(['c']);
expect(context.candidates.map((p) => p.model)).toEqual(['c', 'a']);
});
it('returns full chain when model is not in policy list', () => {