File tree Expand file tree Collapse file tree
Sources/CodexBarCore/Providers/Kimi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ extension KimiUsageSnapshot {
7373 loginMethod: nil )
7474
7575 return UsageSnapshot (
76- primary: rateLimitWindow ?? weeklyWindow ,
77- secondary: rateLimitWindow != nil ? weeklyWindow : nil ,
76+ primary: rateLimitWindow,
77+ secondary: weeklyWindow,
7878 tertiary: nil ,
7979 providerCost: nil ,
8080 updatedAt: self . updatedAt,
Original file line number Diff line number Diff line change @@ -222,10 +222,10 @@ struct KimiUsageSnapshotConversionTests {
222222
223223 let usageSnapshot = snapshot. toUsageSnapshot ( )
224224
225- #expect( usageSnapshot. primary != nil )
225+ #expect( usageSnapshot. primary == nil )
226+ #expect( usageSnapshot. secondary != nil )
226227 let weeklyExpected = 375.0 / 2048.0 * 100.0
227- #expect( abs ( ( usageSnapshot. primary? . usedPercent ?? 0.0 ) - weeklyExpected) < 0.01 )
228- #expect( usageSnapshot. secondary == nil )
228+ #expect( abs ( ( usageSnapshot. secondary? . usedPercent ?? 0.0 ) - weeklyExpected) < 0.01 )
229229 #expect( usageSnapshot. tertiary == nil )
230230 }
231231
@@ -244,7 +244,7 @@ struct KimiUsageSnapshotConversionTests {
244244 updatedAt: now)
245245
246246 let usageSnapshot = snapshot. toUsageSnapshot ( )
247- #expect( usageSnapshot. primary ? . usedPercent == 0.0 )
247+ #expect( usageSnapshot. secondary ? . usedPercent == 0.0 )
248248 }
249249
250250 @Test
@@ -262,7 +262,7 @@ struct KimiUsageSnapshotConversionTests {
262262 updatedAt: now)
263263
264264 let usageSnapshot = snapshot. toUsageSnapshot ( )
265- #expect( usageSnapshot. primary ? . usedPercent == 100.0 )
265+ #expect( usageSnapshot. secondary ? . usedPercent == 100.0 )
266266 }
267267}
268268
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ struct UsageStoreHighestUsageTests {
8080 }
8181
8282 @Test
83- func `automatic metric uses secondary for kimi when ranking highest usage`() {
83+ func `automatic metric uses primary for kimi when ranking highest usage`() {
8484 let settings = SettingsStore (
8585 configStore: testConfigStore ( suiteName: " UsageStoreHighestUsageTests-kimi-automatic " ) ,
8686 zaiTokenStore: NoopZaiTokenStore ( ) ,
You can’t perform that action at this time.
0 commit comments