From 33060a4aab87a79d222b10d088e01acf6ac8be29 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 9 Nov 2026 19:31:13 +0100 Subject: feat: opencode session spend and brand marks in the LLM card --- tests/test_llm.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_llm.py b/tests/test_llm.py index ea28b08..d64aef1 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -30,8 +30,10 @@ class Up(unittest.TestCase): ], "/api/last_session": {"sessions": [ {"program": "opencode", "rows": [ - {"provider": "together", "model": "qwen", "calls": 1}, - {"provider": "deepseek", "model": "v4", "calls": 3}, + {"provider": "together", "model": "qwen", "calls": 1, + "cost_usd": 0.2, "tokens": 200}, + {"provider": "deepseek", "model": "v4", "calls": 3, + "cost_usd": 0.3, "tokens": 300}, ]}, ]}} st = llm.make({"llm": {"url": "http://x"}, @@ -43,6 +45,9 @@ class Up(unittest.TestCase): self.assertEqual(st["opencode"]["tokens"], 1500) self.assertEqual(st["opencode"]["calls"], 4) self.assertEqual(st["opencode"]["model"], "v4") + self.assertEqual(st["opencode"]["session_cost"], 0.5) + self.assertEqual(st["opencode"]["session_calls"], 4) + self.assertEqual(st["opencode"]["session_tokens"], 500) def test_handles_the_real_latest_shape(self): data = {"/api/claude_limits": {"latest": {"context_pct": 42, "five_hour_pct": 10}}, -- cgit v1.2.3