fix(gateway): cap chat.history to 1000 messages
This commit is contained in:
@@ -1823,7 +1823,9 @@ export async function startGatewayServer(
|
||||
sessionId && storePath
|
||||
? readSessionMessages(sessionId, storePath)
|
||||
: [];
|
||||
const max = typeof limit === "number" ? limit : 200;
|
||||
const hardMax = 1000;
|
||||
const requested = typeof limit === "number" ? limit : hardMax;
|
||||
const max = Math.min(hardMax, requested);
|
||||
const messages =
|
||||
rawMessages.length > max ? rawMessages.slice(-max) : rawMessages;
|
||||
const thinkingLevel =
|
||||
|
||||
Reference in New Issue
Block a user