From 2fde61b6f42422d1b8e6e38ee5d1ed90e94592cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Troed=20S=C3=A5ngberg?= Date: Sun, 14 Jun 2026 08:49:00 +0200 Subject: [PATCH] debug: v0.0.56 - enable debug logging with full slot data during prefill --- package.json | 2 +- tui.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c87b15c..2559805 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@troed/oc-ls-stats", - "version": "0.0.55", + "version": "0.0.56", "type": "module", "exports": { "./tui": { diff --git a/tui.tsx b/tui.tsx index 66ea135..cdedc5d 100644 --- a/tui.tsx +++ b/tui.tsx @@ -3,7 +3,7 @@ import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui" import { createMemo, createSignal } from "solid-js" import { appendFileSync } from "fs" -const DEBUG_ENABLED = false +const DEBUG_ENABLED = true const DEBUG_LOG = "/tmp/oc-ls-stats-debug.log" function debug(...args: unknown[]) { if (!DEBUG_ENABLED) return @@ -383,6 +383,7 @@ const tui: TuiPlugin = async (api) => { const now = Date.now() const nt = prefillSlot.n_prompt_tokens ?? 0 const npp = prefillSlot.n_prompt_tokens_processed ?? 0 + debug(`prefill slot=${slotId} full=${JSON.stringify(prefillSlot)} total=${nt} processed=${npp} ratio=${npp > 0 && nt > 0 ? ((npp / nt) * 100).toFixed(1) : 'N/A'}% allSlots=${JSON.stringify(slotList)}`) tracker.prefillTotalTokens = nt tracker.prefillProcessedTokens = npp