[GH-ISSUE #4308] [Issue]: Add chat message range filtering to tool calls #2332

Closed
opened 2026-10-21 05:47:21 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Jul 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4308

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Mari does not limit chat retrieval when asked to use only recent messages or messages after a specified post. It instead attempts to read the entire chat, causing repeated truncation warnings and eventually reaching the command limit.

Expected behavior

Mari should recognize requests such as using only the last 200 messages or messages after a specified post number and apply that range in the chat retrieval tool call.

Actual behavior

Mari attempts to read the entire chat, repeatedly reports that the chat is truncated, and reaches the command limit without completing the requested character card update.

Steps to reproduce

  1. Open a sufficiently long chat.
  2. Ask Mari to use information from only the last 200 messages to update the character card.
  3. Alternatively, ask Mari to look only at messages after a specified post number.
  4. Observe that Mari attempts to read the entire chat, reports repeated truncation, and reaches the command limit.

Environment

  • Marinara Engine version: Not provided
  • Install type: Not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

No logs or attachments provided. The user reports repeated "chat is Truncated" messages followed by the command limit being reached.

Additional context

The user tried rephrasing the request and switching bots without success. They need chat retrieval to support filtering by recent message count or post number.

Discord thread: Mari needs to be able to filter chats
Discord thread link: https://discord.com/channels/1417099416812392641/1532407667761348749
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (1 message)
[2026-07-30T15:20:58.752Z] Leytra: So when I tell mari "Hey I need things from the last 200 messages in the chat used to update the character card"
what it ties to do, is read the whole damn chat, complains that the chat is Truncated 300 times, and reaches command limit.
It needs to be able to recognise  "hey, only look after post number [blah blah]" and actually do that with the tool call, because I've tried rephrasing and switching bots, and had no luck with getting it to do so, and so I can only assume it doesn't have the option to.
[Discord message: https://discord.com/channels/1417099416812392641/1532407667761348749/1532407667761348749]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Jul 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4308 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Mari does not limit chat retrieval when asked to use only recent messages or messages after a specified post. It instead attempts to read the entire chat, causing repeated truncation warnings and eventually reaching the command limit. ## Expected behavior Mari should recognize requests such as using only the last 200 messages or messages after a specified post number and apply that range in the chat retrieval tool call. ## Actual behavior Mari attempts to read the entire chat, repeatedly reports that the chat is truncated, and reaches the command limit without completing the requested character card update. ## Steps to reproduce 1. Open a sufficiently long chat. 2. Ask Mari to use information from only the last 200 messages to update the character card. 3. Alternatively, ask Mari to look only at messages after a specified post number. 4. Observe that Mari attempts to read the entire chat, reports repeated truncation, and reaches the command limit. ## Environment - Marinara Engine version: Not provided - Install type: Not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video No logs or attachments provided. The user reports repeated "chat is Truncated" messages followed by the command limit being reached. ## Additional context The user tried rephrasing the request and switching bots without success. They need chat retrieval to support filtering by recent message count or post number. Discord thread: Mari *needs* to be able to filter chats Discord thread link: https://discord.com/channels/1417099416812392641/1532407667761348749 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (1 message)</summary> ```text [2026-07-30T15:20:58.752Z] Leytra: So when I tell mari "Hey I need things from the last 200 messages in the chat used to update the character card" what it ties to do, is read the whole damn chat, complains that the chat is Truncated 300 times, and reaches command limit. It needs to be able to recognise "hey, only look after post number [blah blah]" and actually do that with the tool call, because I've tried rephrasing and switching bots, and had no luck with getting it to do so, and so I can only assume it doesn't have the option to. [Discord message: https://discord.com/channels/1417099416812392641/1532407667761348749/1532407667761348749] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:47:21 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 30, 2026):

I am implementing this on agent/4308-chat-message-ranges; draft PR #4309 tracks the work against staging.

<!-- gh-comment-id:5133547157 --> @SpicyMarinara commented on GitHub (Jul 30, 2026): I am implementing this on `agent/4308-chat-message-ranges`; draft PR #4309 tracks the work against `staging`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2332
No description provided.