mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:31:25 +00:00
fix(gateway): clamp chat.history to 1000 max
This commit is contained in:
@@ -1824,7 +1824,8 @@ export async function startGatewayServer(
|
||||
? readSessionMessages(sessionId, storePath)
|
||||
: [];
|
||||
const hardMax = 1000;
|
||||
const requested = typeof limit === "number" ? limit : hardMax;
|
||||
const defaultLimit = 200;
|
||||
const requested = typeof limit === "number" ? limit : defaultLimit;
|
||||
const max = Math.min(hardMax, requested);
|
||||
const messages =
|
||||
rawMessages.length > max ? rawMessages.slice(-max) : rawMessages;
|
||||
|
||||
Reference in New Issue
Block a user