mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:41:22 +00:00
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:
committed by
GitHub
parent
da55d70fb0
commit
957b883082
@@ -456,6 +456,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
// Update token+model fields in the session store.
|
||||
{
|
||||
const usage = runResult.meta.agentMeta?.usage;
|
||||
const promptTokens = runResult.meta.agentMeta?.promptTokens;
|
||||
const modelUsed = runResult.meta.agentMeta?.model ?? fallbackModel ?? model;
|
||||
const providerUsed = runResult.meta.agentMeta?.provider ?? fallbackProvider ?? provider;
|
||||
const contextTokens =
|
||||
@@ -479,6 +480,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
deriveSessionTotalTokens({
|
||||
usage,
|
||||
contextTokens,
|
||||
promptTokens,
|
||||
}) ?? input;
|
||||
}
|
||||
await persistSessionEntry();
|
||||
|
||||
Reference in New Issue
Block a user