opencode-statboard 2.10.11 → 2.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-statboard",
3
- "version": "2.10.11",
3
+ "version": "2.10.12",
4
4
  "description": "Real-time dashboard for opencode token usage and cost statistics",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -1569,9 +1569,9 @@ async function startServer() {
1569
1569
  await refresh();
1570
1570
  await refreshModels();
1571
1571
  }
1572
- setInterval(refresh, REFRESH_MS);
1573
- setInterval(refreshModels, 60000);
1574
- setInterval(refreshAttrBundle, 60000);
1572
+ // Ensure attribution bundle is ready before generating trends,
1573
+ // so the trend data uses the full attribution data, not EMPTY_ATTR.
1574
+ await waitForBundle(180000);
1575
1575
  // Today's report eagerly (the common first view). Other periods build on
1576
1576
  // demand in the background via refreshReport stale-while-revalidate.
1577
1577
  for (const d of [1]) {
@@ -1586,6 +1586,9 @@ async function startServer() {
1586
1586
  if (t) trendCache[String(d)] = t;
1587
1587
  } catch (_) {}
1588
1588
  }
1589
+ setInterval(refresh, REFRESH_MS);
1590
+ setInterval(refreshModels, 60000);
1591
+ setInterval(refreshAttrBundle, 60000);
1589
1592
  // (Windows may kill process for excessive I/O on large DB files).
1590
1593
  setTimeout(() => {
1591
1594
  autoBackupIfDue().catch((_) => {});