mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:01:24 +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
@@ -74,4 +74,19 @@ describe("normalizeUsage", () => {
|
||||
}),
|
||||
).toBe(1_550);
|
||||
});
|
||||
|
||||
it("prefers explicit prompt token overrides", () => {
|
||||
expect(
|
||||
deriveSessionTotalTokens({
|
||||
usage: {
|
||||
input: 1_200,
|
||||
cacheRead: 300,
|
||||
cacheWrite: 50,
|
||||
total: 9_999,
|
||||
},
|
||||
promptTokens: 65_000,
|
||||
contextTokens: 200_000,
|
||||
}),
|
||||
).toBe(65_000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user