mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 15:04:33 +00:00
fix: context overflow compaction and subagent announce improvements (#11664) (thanks @tyler6204)
* initial commit * feat: implement deriveSessionTotalTokens function and update usage tests * Added deriveSessionTotalTokens function to calculate total tokens based on usage and context tokens. * Updated usage tests to include cases for derived session total tokens. * Refactored session usage calculations in multiple files to utilize the new function for improved accuracy. * fix: restore overflow truncation fallback + changelog/test hardening (#11551) (thanks @tyler6204)
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
BlockReplyChunking,
|
||||
SubscribeEmbeddedPiSessionParams,
|
||||
} from "./pi-embedded-subscribe.types.js";
|
||||
import type { NormalizedUsage } from "./usage.js";
|
||||
|
||||
export type EmbeddedSubscribeLogger = {
|
||||
debug: (message: string) => void;
|
||||
@@ -100,6 +101,10 @@ export type EmbeddedPiSubscribeContext = {
|
||||
noteCompactionRetry: () => void;
|
||||
resolveCompactionRetry: () => void;
|
||||
maybeResolveCompactionWait: () => void;
|
||||
recordAssistantUsage: (usage: unknown) => void;
|
||||
incrementCompactionCount: () => void;
|
||||
getUsageTotals: () => NormalizedUsage | undefined;
|
||||
getCompactionCount: () => number;
|
||||
};
|
||||
|
||||
export type EmbeddedPiSubscribeEvent =
|
||||
|
||||
Reference in New Issue
Block a user