mirror of https://github.com/openclaw/openclaw.git
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
This commit is contained in:
parent
b601c7cb8f
commit
97a8ba89fd
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ export async function buildStatusText(params: {
|
|||
subagentsLine,
|
||||
taskLine,
|
||||
mediaDecisions: params.mediaDecisions,
|
||||
includeTranscriptUsage: false,
|
||||
includeTranscriptUsage: true,
|
||||
});
|
||||
|
||||
return statusText;
|
||||
|
|
|
|||
Loading…
Reference in New Issue