fix(qa): reject fractional live token usage · openclaw/openclaw@8a7906c
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -134,6 +134,24 @@ describe("token efficiency report", () => {
|
134 | 134 | ]); |
135 | 135 | }); |
136 | 136 | |
| 137 | +it("fails live reports with non-integer token usage evidence", () => { |
| 138 | +const report = buildTokenEfficiencyReport({ |
| 139 | +summary: makeLiveSummary([ |
| 140 | +makeRuntimeParity( |
| 141 | +"fractional-live-usage", |
| 142 | +makeCell("openclaw", { inputTokens: 100.5, outputTokens: 0, totalTokens: 100.5 }), |
| 143 | +makeCell("codex", { inputTokens: 101, outputTokens: 0, totalTokens: 101 }), |
| 144 | +), |
| 145 | +]), |
| 146 | +}); |
| 147 | + |
| 148 | +expect(report.pass).toBe(false); |
| 149 | +expect(report.failures).toEqual([ |
| 150 | +"fractional-live-usage openclaw live usage inputTokens must be a non-negative integer", |
| 151 | +"fractional-live-usage openclaw live usage totalTokens must be a non-negative integer", |
| 152 | +]); |
| 153 | +}); |
| 154 | + |
137 | 155 | it("fails empty live runtime summaries instead of treating them as skipped proof", () => { |
138 | 156 | const report = buildTokenEfficiencyReport({ |
139 | 157 | generatedAt: "2026-05-10T00:00:00.000Z", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。