Address Codex review: truncation from raw count; session list cap

- Use raw messages.length (before NO_REPLY filter) for chatHistoryTruncated
  so a full 25-message page with filtered entries still shows truncation notice.
- Raise sessions.list limit for chat refresh from 40 to 60 so the active
  session is more likely included in the list for metadata (reasoning level, etc.).

Made-with: Cursor
This commit is contained in:
OpenClaw Contributor 2026-03-16 19:10:30 +00:00
parent b1b264e2bb
commit 1f291ad422
2 changed files with 2 additions and 2 deletions

View File

@ -357,7 +357,7 @@ export async function refreshChat(host: ChatHost, opts?: { scheduleScroll?: bool
loadChatHistory(host as unknown as OpenClawApp),
loadSessions(host as unknown as OpenClawApp, {
activeMinutes: CHAT_SESSIONS_ACTIVE_MINUTES,
limit: 40,
limit: 60,
includeGlobal: true,
includeUnknown: true,
}),

View File

@ -89,7 +89,7 @@ export async function loadChatHistory(state: ChatState) {
state.chatStream = null;
state.chatStreamStartedAt = null;
state.chatMessages = filtered;
state.chatHistoryTruncated = filtered.length >= CHAT_HISTORY_REQUEST_LIMIT;
state.chatHistoryTruncated = messages.length >= CHAT_HISTORY_REQUEST_LIMIT;
} catch (err) {
state.lastError = String(err);
state.chatHistoryTruncated = false;