@threadbase-sh/streamer 1.69.0 → 1.69.1

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
@@ -8838,11 +8838,14 @@ var ConversationHandlers = class {
8838
8838
  const isFirstLoad = !url.searchParams.has("before_index");
8839
8839
  if (isFirstLoad) {
8840
8840
  const tail = this.cache.getConversationTail(id);
8841
- if (tail && tail.messages.length > 0) {
8841
+ const usableTail = (tail?.messages ?? []).filter(
8842
+ (message) => (message.text ?? "").length > 0 || (message.content?.length ?? 0) > 0
8843
+ );
8844
+ if (usableTail.length > 0) {
8842
8845
  const cachedMeta = this.cache.getMetaById(id);
8843
8846
  const cachedProvider = cachedMeta?.provider ?? CLAUDE_CODE_PROVIDER;
8844
8847
  const availability2 = classifyResumability(cachedMeta?.projectPath);
8845
- const messagesPayload2 = tail.messages.map((m, idx) => ({
8848
+ const messagesPayload2 = usableTail.map((m, idx) => ({
8846
8849
  message_index: idx,
8847
8850
  role: m.role,
8848
8851
  timestamp: m.timestamp,
@@ -8868,8 +8871,8 @@ var ConversationHandlers = class {
8868
8871
  },
8869
8872
  messages: messagesPayload2,
8870
8873
  message_pagination: {
8871
- total: tail.tailSize,
8872
- before_index: tail.tailSize,
8874
+ total: usableTail.length,
8875
+ before_index: usableTail.length,
8873
8876
  from_index: 0,
8874
8877
  has_more_older: false,
8875
8878
  next_before_index: null