fix(session): prevent silent overflow on parent thread forks (#26912)

Lands #26912 from @markshields-tl with configurable session.parentForkMaxTokens and docs/tests/changelog updates.

Co-authored-by: Mark Shields <239231357+markshields-tl@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-25 23:53:43 +00:00
parent 8d1481cb4a
commit eb73e87f18
11 changed files with 211 additions and 14 deletions

View File

@@ -112,6 +112,12 @@ export type SessionConfig = {
store?: string;
typingIntervalSeconds?: number;
typingMode?: TypingMode;
/**
* Max parent transcript token count allowed for thread/session forking.
* If parent totalTokens is above this value, OpenClaw skips parent fork and
* starts a fresh thread session instead. Set to 0 to disable this guard.
*/
parentForkMaxTokens?: number;
mainKey?: string;
sendPolicy?: SessionSendPolicyConfig;
agentToAgent?: {