mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 02:16:27 +00:00
fix(pricing): handle date-stamped 4.6 thinking model IDs
This commit is contained in:
1 parent
9a7ca3f1c0
commit
d31f85b0d4
2 files changed
+23
-3
No files matched your search
@@ -120,6 +120,18 @@ describe('model-pricing', () => {
|
||||
expect(opus46.inputPerMillion).toBe(5.0);
|
||||
expect(opus46.outputPerMillion).toBe(25.0);
|
||||
});
|
||||
|
||||
it('should match date-stamped thinking Claude Opus 4.6 to correct pricing', () => {
|
||||
const opus46 = getModelPricing('claude-opus-4-6-20260101-thinking');
|
||||
expect(opus46.inputPerMillion).toBe(5.0);
|
||||
expect(opus46.outputPerMillion).toBe(25.0);
|
||||
});
|
||||
|
||||
it('should match provider-prefixed date-stamped thinking model to correct pricing', () => {
|
||||
const opus46 = getModelPricing('anthropic/claude-opus-4-6-20260101-thinking');
|
||||
expect(opus46.inputPerMillion).toBe(5.0);
|
||||
expect(opus46.outputPerMillion).toBe(25.0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('calculateCost', () => {
|
||||
@@ -209,6 +221,10 @@ describe('model-pricing', () => {
|
||||
expect(hasCustomPricing('qwen3-coder')).toBe(true);
|
||||
});
|
||||
|
||||
it('should not treat date-stamped non-Claude IDs as deterministic aliases', () => {
|
||||
expect(hasCustomPricing('qwen3-32b-20260101')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for unknown models', () => {
|
||||
expect(hasCustomPricing('unknown-model-xyz')).toBe(false);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user