mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 07:12:12 +03:00
fix(auto): address PR #2131 review issues
- Fix OAuth expiry handling for ISO strings in virtualFactory.ts - Move AutoRoutingBanner test from src/ to tests/unit/shared/components/ - Remove mock metrics from analytics endpoint, return only real data - Fix error handling for bare 'auto' prefix in chat.ts (check isAutoRouting) - Update vitest.config.ts to include tests/unit/**/*.test.tsx pattern
This commit is contained in:
@@ -59,22 +59,14 @@ export async function GET(request: Request) {
|
||||
GROUP BY provider
|
||||
ORDER BY count DESC
|
||||
LIMIT 10
|
||||
`
|
||||
`
|
||||
)
|
||||
.all() as Array<{ provider: string; count: number }>;
|
||||
|
||||
// Mock metrics (would need actual scoring data from auto-combo engine)
|
||||
const mockMetrics = {
|
||||
avgSelectionScore: 0.85,
|
||||
explorationRate: 0.05,
|
||||
lkgpHitRate: 0.72,
|
||||
};
|
||||
|
||||
return NextResponse.json({
|
||||
totalRequests: totalRequests.count,
|
||||
variantBreakdown,
|
||||
topProviders,
|
||||
...mockMetrics,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Auto-routing analytics error:", error);
|
||||
@@ -82,9 +74,6 @@ export async function GET(request: Request) {
|
||||
totalRequests: 0,
|
||||
variantBreakdown: {},
|
||||
topProviders: [],
|
||||
avgSelectionScore: 0,
|
||||
explorationRate: 0.05,
|
||||
lkgpHitRate: 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user