fix: require complete model catalog pricing tiers · openclaw/openclaw@a5d46c4
shakkernerd
·
2026-04-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -508,6 +508,8 @@ describe("loadPluginManifestRegistry", () => {
|
508 | 508 | { |
509 | 509 | input: 0.6, |
510 | 510 | output: 2.5, |
| 511 | +cacheRead: 0.15, |
| 512 | +cacheWrite: 0.6, |
511 | 513 | range: [0, 256000], |
512 | 514 | }, |
513 | 515 | ], |
@@ -582,6 +584,8 @@ describe("loadPluginManifestRegistry", () => {
|
582 | 584 | { |
583 | 585 | input: 0.6, |
584 | 586 | output: 2.5, |
| 587 | +cacheRead: 0.15, |
| 588 | +cacheWrite: 0.6, |
585 | 589 | range: [0, 256000], |
586 | 590 | }, |
587 | 591 | ], |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -717,7 +717,15 @@ function normalizeModelCatalogTieredCost(
|
717 | 717 | } |
718 | 718 | const input = normalizeModelCatalogNumber(entry.input); |
719 | 719 | const output = normalizeModelCatalogNumber(entry.output); |
720 | | -if (input === undefined || output === undefined || !Array.isArray(entry.range)) { |
| 720 | +const cacheRead = normalizeModelCatalogNumber(entry.cacheRead); |
| 721 | +const cacheWrite = normalizeModelCatalogNumber(entry.cacheWrite); |
| 722 | +if ( |
| 723 | +input === undefined || |
| 724 | +output === undefined || |
| 725 | +cacheRead === undefined || |
| 726 | +cacheWrite === undefined || |
| 727 | +!Array.isArray(entry.range) |
| 728 | +) { |
721 | 729 | continue; |
722 | 730 | } |
723 | 731 | const rangeValues = entry.range |
@@ -732,13 +740,11 @@ function normalizeModelCatalogTieredCost(
|
732 | 740 | if (!range) { |
733 | 741 | continue; |
734 | 742 | } |
735 | | -const cacheRead = normalizeModelCatalogNumber(entry.cacheRead); |
736 | | -const cacheWrite = normalizeModelCatalogNumber(entry.cacheWrite); |
737 | 743 | normalized.push({ |
738 | 744 | input, |
739 | 745 | output, |
740 | | -...(cacheRead !== undefined ? { cacheRead } : {}), |
741 | | -...(cacheWrite !== undefined ? { cacheWrite } : {}), |
| 746 | + cacheRead, |
| 747 | + cacheWrite, |
742 | 748 | range, |
743 | 749 | }); |
744 | 750 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。