fix: 全量替换 claude-fable-5 → claude-opus-4-8(模型不可用)

- models.ts: 所有档位默认值、回退链、conflict 固定值全部换为 opus-4-8
- 回退链从三项缩为两项 [opus-4-8, sonnet-4-6](删除重复项)
- metrics.ts: 额度权重 opus-4-8 升为 1.0(现为最高档)
- 测试同步更新

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-14 15:14:09 +08:00
parent 433b2dc232
commit a5a3c967ce
4 changed files with 38 additions and 40 deletions
+4 -4
View File
@@ -36,10 +36,10 @@ test('metrics 纯函数:percentile / ratio / estimateCostUnits', () => {
assert.equal(ratio(2, 3), 0.6667);
assert.equal(ratio(0, 0), null); // 无样本不除零
assert.equal(costPerMin('claude-fable-5'), 1.0);
assert.equal(costPerMin('claude-opus-4-8'), 1.0);
assert.equal(costPerMin('未知模型'), DEFAULT_COST_PER_MIN);
assert.equal(estimateCostUnits(60_000, 'claude-fable-5'), 1.0); // 1 分钟 × 1.0
assert.equal(estimateCostUnits(120_000, 'claude-opus-4-8'), 1.2); // 2 分钟 × 0.6
assert.equal(estimateCostUnits(60_000, 'claude-opus-4-8'), 1.0); // 1 分钟 × 1.0
assert.equal(estimateCostUnits(120_000, 'claude-sonnet-4-6'), 0.4); // 2 分钟 × 0.2
});
// ──────────────── 空数据不崩 ────────────────
@@ -166,7 +166,7 @@ test('metrics 按模型额度:时长×档位 粗估,estimated=true', () => {
const m = s.metrics(p.id);
assert.equal(m.byModel.length, 1);
assert.deepEqual(m.byModel[0], {
model: 'claude-opus-4-8', runs: 2, durationMs: 120_000, estCostUnits: 1.2, estimated: true,
model: 'claude-opus-4-8', runs: 2, durationMs: 120_000, estCostUnits: 2.0, estimated: true,
});
assert.equal(m.estimated, true);
s.close();