fix(agents): stabilize overflow compaction retries and session context accounting (openclaw#14102) thanks @vpesh

Verified:
- CI checks for commit 86a7ecb45e
- Rebase conflict resolution for compatibility with latest main

Co-authored-by: vpesh <9496634+vpesh@users.noreply.github.com>
This commit is contained in:
Vladimir Peshekhonov
2026-02-13 00:53:13 +01:00
committed by GitHub
parent da55d70fb0
commit 957b883082
13 changed files with 148 additions and 21 deletions

View File

@@ -25,6 +25,7 @@ export async function persistSessionUsageUpdate(params: {
modelUsed?: string;
providerUsed?: string;
contextTokensUsed?: number;
promptTokens?: number;
systemPromptReport?: SessionSystemPromptReport;
cliSessionId?: string;
logLabel?: string;
@@ -56,6 +57,7 @@ export async function persistSessionUsageUpdate(params: {
deriveSessionTotalTokens({
usage: usageForContext,
contextTokens: resolvedContextTokens,
promptTokens: params.promptTokens,
}) ?? input,
modelProvider: params.providerUsed ?? entry.modelProvider,
model: params.modelUsed ?? entry.model,