mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-02 21:04:32 +00:00
calculateCost ended with 'total > 0 ? total : null', and callers read null as "no cost to report" - the stats table prints N/A and hides the Cost section entirely when no model yields a number. Testing the total conflated a zero cost with an unknown one. A model the user deliberately priced at 0 (a free OpenRouter variant, a local Ollama or LM Studio model) was reported as N/A, and the Cost section vanished when it was the only model in the session. Decide on the pricing and the usage before the arithmetic, then return the total unconditionally. The no-usage case still returns null, which statsCommand.test.ts documents as deliberate. |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| index.ts | ||
| package.json | ||
| test-setup.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||