[GH-ISSUE #1910] [Feature]: Long-Term Memory: keep the range visible in Chat Summaries rows with long chat names #1817

Closed
opened 2026-11-07 16:36:52 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1910

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

#1783 fixed this for Sources → Chat Messages. Sources → Chat Summaries has the same problem. Each row's title is <chat name>, msgs <range>, and the line is cut with "…" when it doesn't fit. With a long chat name, the cut lands inside the name, so the range is hidden. Every summary of one chat then looks the same. The second line (Import <same title>) is cut the same way.

The range part takes several forms, all built in summaries():

Summary kind Range today
Roleplay/game summary with a message range 241-300 (1-based, Engine rangeStartIndex/rangeEndIndex)
Summary of the last N messages last 40
Agent summary / no range / legacy metadata.summary agent summary, last messages
Conversation day or week summary 27.07.2026 (the day or week key)
Game session summary game session 3

Conversation-mode chats are hit hardest: every row is a date, and the date is what gets cut.

Today:
[ ] My Very Long Adventure With Some Friends In The Ci…  READY
    Import My Very Long Adventure With Some Friends…
[ ] My Very Long Adventure With Some Friends In The Ci…  READY

Wanted:
[ ] My Very Long Adventure With So…  messages 1–120  READY
[ ] My Very Long Adventure With So…  game session 3  READY
[ ] My Daily Chat With A Very Lon…   27.07.2026      READY

Proposed package or change

Package-only change to Long-Term Memory's Sources workspace. No Engine change.

Chat summary preview samples carry their chat name and range as data, and the row renders them in #1783's slot: the name is cut, and the range label stays whole. The title string does not change. It is still the source note title, the accessible name, the task-tray title and the write-failure title. So no existing source note is renamed or marked as updated.

  • A summary with a numbered message range sets the existing messageRange. Its label becomes the localized messages 241–300, the same as Chat Messages rows.
  • Every other form sets a new sibling field, summaryRange: { chatName, label }. label is today's range text, unchanged (last 40, agent summary, last messages, 27.07.2026, game session 3). It stays English, as it is in today's title.

Minimal fix

  • Shared packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema/sources.ts: next to messageRange (~45), ltmInteropPreviewSampleBaseSchema gains an optional summaryRange: { chatName: string 1..240, label: string 1..80 }, .strict(). A sample sets at most one of messageRange and summaryRange.
  • Server packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts
    • summaries() (~254): the ordinary-entry branch (~262–282) also returns first/last when rangeStartIndex and rangeEndIndex are both set. The range string is unchanged.
    • Candidate (~55) gains an optional summaryRange. The chat summary builder (~603–650, title at ~616) sets messageRange: { chatName, first, last } when the entry has first/last, and otherwise sets summaryRange: { chatName, label: entry.range }. chatName is chatDisplayName.slice(0, 240), as in the Chat Messages builder (~691).
    • previewSample (~829, the copy at ~838) copies summaryRange the same way it copies messageRange.
    • Title, summary, evidence (message_range:<range>), source ids and previewOrder do not change.
  • Client packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx, renderFlatSourceRow (~1501; const range = row.messageRange at ~1504, name at ~1545)
    • Render the same name + label pair when row.summaryRange is set: the same data-ltm-source-chat-name element, and a data-ltm-source-message-range element whose text is summaryRange.label.
    • Rows with neither field render exactly as today.
  • No new locale keys: numbered ranges reuse messageValue1 / messagesValue1ToValue2.

Regression:

  1. tests/long-term-memory-conversation-summary-import.regression.ts:
    • The day sample chat-conversation:day:27.07.2026 carries summaryRange: { chatName: <its chat name>, label: "27.07.2026" } and no messageRange.
    • Replace the "only Chat Messages samples carry a message range" check (~313): character samples carry neither field.
    • A roleplay chat with a rangeStartIndex/rangeEndIndex entry, a messageCount entry and a game session carries messageRange { first, last }, summaryRange "last N" and summaryRange "game session N" respectively. All titles are unchanged (<chat>, msgs …).
  2. tests/long-term-memory-browser.regression.ts: next to the #1783 check (~8689), on a 320px-wide Chat Summaries tab with a long chat name:
    • The numbered row's label reads messages 1–120, and a date row's label reads its date.
    • Each label and the status badge are inside the row.
    • The chat name element is the one that is cut.
  3. tests/long-term-memory-routes.regression.ts (~6364): the write-failure title Observatory, msgs last messages stays as is. This proves the title did not change.

Non-goals

  • Localizing or reformatting the non-numbered labels (last 40, dates, game session 3). They stay as they read today.
  • Changing msgs in the title, or the title itself. That would touch source note titles.
  • The repeated Import <title> second line, which is the same separate polish item #1783 left out.

Why should this be optional?

Long-Term Memory is already a catalog package, and this changes only how its own Sources list lays out one row type.

Alternatives considered

  • Widen messageRange into a union ({ first, last } | { label }). There would be one field, but every existing messageRange reader and the strict schema would change shape. Rejected in favour of an additive sibling.
  • Structured kinds ({ kind: "last", count }, { kind: "day", date }, …) localized in the client. This is more correct for Korean, but it adds about five locale keys and date formatting for text that is English today. It can follow if wanted.
  • Parse the range out of the title in the client. This ties the UI to an English display string. #1783 rejected it for the same reason.

Additional context

Follow-up to #1783 (PR #1804, LTM 1.5.6), which was scoped to Chat Messages rows only. The selected-items list and the workbench header already wrap the title and are fine.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1910 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? #1783 fixed this for Sources → Chat Messages. Sources → Chat Summaries has the same problem. Each row's title is `<chat name>, msgs <range>`, and the line is cut with "…" when it doesn't fit. With a long chat name, the cut lands inside the name, so the range is hidden. Every summary of one chat then looks the same. The second line (`Import <same title>`) is cut the same way. The range part takes several forms, all built in `summaries()`: | Summary kind | Range today | |---|---| | Roleplay/game summary with a message range | `241-300` (1-based, Engine `rangeStartIndex`/`rangeEndIndex`) | | Summary of the last N messages | `last 40` | | Agent summary / no range / legacy `metadata.summary` | `agent summary`, `last messages` | | Conversation day or week summary | `27.07.2026` (the day or week key) | | Game session summary | `game session 3` | Conversation-mode chats are hit hardest: every row is a date, and the date is what gets cut. ``` Today: [ ] My Very Long Adventure With Some Friends In The Ci… READY Import My Very Long Adventure With Some Friends… [ ] My Very Long Adventure With Some Friends In The Ci… READY Wanted: [ ] My Very Long Adventure With So… messages 1–120 READY [ ] My Very Long Adventure With So… game session 3 READY [ ] My Daily Chat With A Very Lon… 27.07.2026 READY ``` ## Proposed package or change Package-only change to Long-Term Memory's Sources workspace. No Engine change. Chat summary preview samples carry their chat name and range as data, and the row renders them in #1783's slot: the name is cut, and the range label stays whole. The title string does not change. It is still the source note title, the accessible name, the task-tray title and the write-failure title. So no existing source note is renamed or marked as updated. - A summary with a numbered message range sets the existing `messageRange`. Its label becomes the localized `messages 241–300`, the same as Chat Messages rows. - Every other form sets a new sibling field, `summaryRange: { chatName, label }`. `label` is today's range text, unchanged (`last 40`, `agent summary`, `last messages`, `27.07.2026`, `game session 3`). It stays English, as it is in today's title. ### Minimal fix - Shared `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema/sources.ts`: next to `messageRange` (~45), `ltmInteropPreviewSampleBaseSchema` gains an optional `summaryRange: { chatName: string 1..240, label: string 1..80 }`, `.strict()`. A sample sets at most one of `messageRange` and `summaryRange`. - Server `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts` - `summaries()` (~254): the ordinary-entry branch (~262–282) also returns `first`/`last` when `rangeStartIndex` and `rangeEndIndex` are both set. The `range` string is unchanged. - `Candidate` (~55) gains an optional `summaryRange`. The chat summary builder (~603–650, title at ~616) sets `messageRange: { chatName, first, last }` when the entry has `first`/`last`, and otherwise sets `summaryRange: { chatName, label: entry.range }`. `chatName` is `chatDisplayName.slice(0, 240)`, as in the Chat Messages builder (~691). - `previewSample` (~829, the copy at ~838) copies `summaryRange` the same way it copies `messageRange`. - Title, `summary`, evidence (`message_range:<range>`), source ids and previewOrder do not change. - Client `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx`, `renderFlatSourceRow` (~1501; `const range = row.messageRange` at ~1504, name at ~1545) - Render the same name + label pair when `row.summaryRange` is set: the same `data-ltm-source-chat-name` element, and a `data-ltm-source-message-range` element whose text is `summaryRange.label`. - Rows with neither field render exactly as today. - No new locale keys: numbered ranges reuse `messageValue1` / `messagesValue1ToValue2`. Regression: 1. `tests/long-term-memory-conversation-summary-import.regression.ts`: - The day sample `chat-conversation:day:27.07.2026` carries `summaryRange: { chatName: <its chat name>, label: "27.07.2026" }` and no `messageRange`. - Replace the "only Chat Messages samples carry a message range" check (~313): character samples carry neither field. - A roleplay chat with a `rangeStartIndex`/`rangeEndIndex` entry, a `messageCount` entry and a game session carries `messageRange { first, last }`, `summaryRange "last N"` and `summaryRange "game session N"` respectively. All titles are unchanged (`<chat>, msgs …`). 2. `tests/long-term-memory-browser.regression.ts`: next to the #1783 check (~8689), on a 320px-wide Chat Summaries tab with a long chat name: - The numbered row's label reads `messages 1–120`, and a date row's label reads its date. - Each label and the status badge are inside the row. - The chat name element is the one that is cut. 3. `tests/long-term-memory-routes.regression.ts` (~6364): the write-failure title `Observatory, msgs last messages` stays as is. This proves the title did not change. ### Non-goals - Localizing or reformatting the non-numbered labels (`last 40`, dates, `game session 3`). They stay as they read today. - Changing `msgs` in the title, or the title itself. That would touch source note titles. - The repeated `Import <title>` second line, which is the same separate polish item #1783 left out. ## Why should this be optional? Long-Term Memory is already a catalog package, and this changes only how its own Sources list lays out one row type. ## Alternatives considered - **Widen `messageRange` into a union** (`{ first, last } | { label }`). There would be one field, but every existing `messageRange` reader and the strict schema would change shape. Rejected in favour of an additive sibling. - **Structured kinds** (`{ kind: "last", count }`, `{ kind: "day", date }`, …) localized in the client. This is more correct for Korean, but it adds about five locale keys and date formatting for text that is English today. It can follow if wanted. - **Parse the range out of the title in the client.** This ties the UI to an English display string. #1783 rejected it for the same reason. ## Additional context Follow-up to #1783 (PR #1804, LTM 1.5.6), which was scoped to Chat Messages rows only. The selected-items list and the workbench header already wrap the title and are fine. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:36:52 +07:00
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-Agents#1817
No description provided.