From 97a8ba89fd3d1f3a62b8ede3b51208d274bcbb98 Mon Sep 17 00:00:00 2001 From: jjjojoj Date: Thu, 26 Mar 2026 16:32:37 +0800 Subject: [PATCH] fix: use transcript usage as fallback for /status token display When using custom providers like LM Studio, Ollama, or DashScope, token counts in /status show as 0 because the agent meta store does not always have usage data populated for these providers. Fix: set includeTranscriptUsage: true in both /status command and the session_status tool. This enables the existing fallback path that reads usage from the session transcript JSONL file when the meta store has zero/missing token counts. The merge logic already guards against overwriting valid data: - totalTokens: only updated when zero or transcript value is larger - inputTokens/outputTokens: only filled when zero/missing - model/contextTokens: only filled when missing Fixes #54995 --- src/agents/tools/session-status-tool.ts | 1 + src/auto-reply/reply/commands-status.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agents/tools/session-status-tool.ts b/src/agents/tools/session-status-tool.ts index 48f959642f8..7ccd43975ec 100644 --- a/src/agents/tools/session-status-tool.ts +++ b/src/agents/tools/session-status-tool.ts @@ -499,6 +499,7 @@ export function createSessionStatusTool(opts?: { skipDefaultTaskLookup: true, primaryModelLabelOverride: primaryModelLabel, ...(providerForCard ? {} : { modelAuthOverride: undefined }), + includeTranscriptUsage: true, }); const fullStatusText = taskLine && !statusText.includes(taskLine) ? `${statusText}\n${taskLine}` : statusText; diff --git a/src/auto-reply/reply/commands-status.ts b/src/auto-reply/reply/commands-status.ts index a8870ebee6d..a2efea232fb 100644 --- a/src/auto-reply/reply/commands-status.ts +++ b/src/auto-reply/reply/commands-status.ts @@ -345,7 +345,7 @@ export async function buildStatusText(params: { subagentsLine, taskLine, mediaDecisions: params.mediaDecisions, - includeTranscriptUsage: false, + includeTranscriptUsage: true, }); return statusText;