From 57af33630d880a8d433ed2eb8711baffc918543e Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Wed, 18 Nov 2026 13:39:34 -0600 Subject: [PATCH] test(triage): a repeated usage.begin keeps the first baseline (review round, #1873, lane triage-cap) --- packages/webui/tests/triage-host.test.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/webui/tests/triage-host.test.mjs b/packages/webui/tests/triage-host.test.mjs index 345f073c7..56aa6988b 100644 --- a/packages/webui/tests/triage-host.test.mjs +++ b/packages/webui/tests/triage-host.test.mjs @@ -785,6 +785,8 @@ test("cap: the relay writes one line per turn, known or unknown, and a session t spend(dataRoot, 7); // before the turn: the baseline holds it assert.deepEqual(await c.call("usage.begin", { turn: first.id }), {}); spend(dataRoot, 40); + // A repeated begin for the same turn keeps the first baseline, so the tokens before it still count. + assert.deepEqual(await c.call("usage.begin", { turn: first.id }), {}); spend(dataRoot, 2); await c.call("usage.end", { turn: first.id }); // A repeated end does not count the turn twice.