@nextclaw/kernel 0.6.27 → 0.6.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7107,7 +7107,7 @@ var SessionManager = class {
7107
7107
  limit,
7108
7108
  ...cursor ? { cursor } : {}
7109
7109
  });
7110
- if (!page) return page;
7110
+ if (!page || cursor) return page;
7111
7111
  const record = await this.options.journalStore.getSession(normalizedSessionId);
7112
7112
  if (!record) return page;
7113
7113
  const contextWindow = (await this.createSummaryWithContextWindow(record)).contextWindow ?? null;
@@ -11107,9 +11107,9 @@ var NcpAgentSessionMessageProjectionStore = class {
11107
11107
  if (!meta) return null;
11108
11108
  const uniqueTailMessages = deduplicateNcpAgentSessionTailMessages(tailMessages ?? []);
11109
11109
  const tailById = new Map(uniqueTailMessages.map((message) => [message.id, message]));
11110
- const messageOrdinals = await this.readMessageOrdinals(sessionId, meta);
11111
- const additionalTailMessages = uniqueTailMessages.filter((message) => !messageOrdinals.has(message.id));
11112
- const limit = Number.isFinite(requestedLimit) ? Math.min(200, Math.max(1, Math.trunc(requestedLimit))) : 80;
11110
+ const messageOrdinals = uniqueTailMessages.length > 0 ? await this.readMessageOrdinals(sessionId, meta) : null;
11111
+ const additionalTailMessages = messageOrdinals ? uniqueTailMessages.filter((message) => !messageOrdinals.has(message.id)) : [];
11112
+ const limit = Number.isFinite(requestedLimit) ? Math.min(200, Math.max(1, Math.trunc(requestedLimit))) : 40;
11113
11113
  const boundary = cursor ? decodeNcpAgentSessionMessageCursor(cursor, meta.total + 1) : meta.total + 1;
11114
11114
  const includeTail = !cursor;
11115
11115
  const stableLimit = includeTail ? Math.max(0, limit - additionalTailMessages.length) : limit;