[GH-ISSUE #1974] [Issue]: Long-Term Memory whole-number settings fail to save when a decimal is typed #1850

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

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

Originally assigned to: @Promansis on GitHub.

Summary

Nine Long-Term Memory number fields hold settings that the server accepts only as whole numbers (.int()), but the field passes a typed decimal through unchanged. Typing 2.5 into "Max memories", for example, makes the settings save fail validation. #1964 fixed the same problem for the Advanced Memory batch size by adding an integer prop to NumberField. These nine fields don't pass that prop yet.

Affected package

long-term-memory (1.5.20 on staging 92e3fd32d)

Expected behavior

A whole-number field rounds a typed decimal after clamping it, then shows and saves the rounded value, the way the Advanced Memory batch size already does.

Actual behavior

The decimal goes into the form state unchanged. Saving sends it to the settings route, where the shared schema's z.number().int() rejects it.

Steps to reproduce

  1. Open Memory Settings → Recall.
  2. Type 2.5 into "Max memories" (or any field listed below) and leave the field.
  3. Save. The save fails validation.

Environment

  • Marinara Engine version: staging
  • Package version: long-term-memory 1.5.20
  • Install type: source
  • OS + version: any
  • Browser or app shell: any

Logs, screenshots, or video

Found by code reading. Dottore asked about it on PR #1970 (2026-10-31).

Additional context

These fields, at staging 92e3fd32d, use .int() in shared/src/features/agents/long-term-memory/schema/settings.ts and have no rounding on the client:

settings/MemorySettings.tsx

  • longTermMemoryBudgetTokens (line 676)
  • longTermMemoryMaxChunks (690)
  • longTermMemoryRecallContextMessages (698)
  • extractionFormState.maxOutputTokens (1071)
  • extractionFormState.maxSourceTokens (1186)
  • extractionFormState.existingNoteMaxChunks (1200)
  • extractionFormState.existingNoteMaxTokens (1215)

ChatSettings.tsx (per-chat overrides)

  • effectiveBudget → longTermMemoryBudgetTokens (128)
  • effectiveMaxChunks → longTermMemoryMaxChunks (150)

These stay decimal and are out of scope: longTermMemoryScoreThreshold (782), the four recall weights (798–825) and temperature (1170).

Minimal fix

  • Files: packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx and .../long-term-memory/ChatSettings.tsx.
  • Change: add the existing integer prop to the nine <NumberField> callers listed above. Don't change shared-controls.tsx: its integer ? Math.round(next) : next clamp from #1964 already does the rounding.
  • Regression: extend tests/long-term-memory-feedback-clarity-ui.regression.mjs next to the #1964 block. Assert that each of the nine fields (matched by its value={...} expression) carries integer, and that the six decimal fields don't.
  • Release: LTM patch bump and rebuild (client bundle, artifact, catalog).

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 @Promansis on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1974 Originally assigned to: @Promansis on GitHub. ## Summary Nine Long-Term Memory number fields hold settings that the server accepts only as whole numbers (`.int()`), but the field passes a typed decimal through unchanged. Typing `2.5` into "Max memories", for example, makes the settings save fail validation. #1964 fixed the same problem for the Advanced Memory batch size by adding an `integer` prop to `NumberField`. These nine fields don't pass that prop yet. ## Affected package long-term-memory (1.5.20 on staging 92e3fd32d) ## Expected behavior A whole-number field rounds a typed decimal after clamping it, then shows and saves the rounded value, the way the Advanced Memory batch size already does. ## Actual behavior The decimal goes into the form state unchanged. Saving sends it to the settings route, where the shared schema's `z.number().int()` rejects it. ## Steps to reproduce 1. Open Memory Settings → Recall. 2. Type `2.5` into "Max memories" (or any field listed below) and leave the field. 3. Save. The save fails validation. ## Environment - Marinara Engine version: staging - Package version: long-term-memory 1.5.20 - Install type: source - OS + version: any - Browser or app shell: any ## Logs, screenshots, or video Found by code reading. Dottore asked about it on PR #1970 (2026-10-31). ## Additional context These fields, at staging 92e3fd32d, use `.int()` in `shared/src/features/agents/long-term-memory/schema/settings.ts` and have no rounding on the client: `settings/MemorySettings.tsx` - `longTermMemoryBudgetTokens` (line 676) - `longTermMemoryMaxChunks` (690) - `longTermMemoryRecallContextMessages` (698) - `extractionFormState.maxOutputTokens` (1071) - `extractionFormState.maxSourceTokens` (1186) - `extractionFormState.existingNoteMaxChunks` (1200) - `extractionFormState.existingNoteMaxTokens` (1215) `ChatSettings.tsx` (per-chat overrides) - `effectiveBudget` → `longTermMemoryBudgetTokens` (128) - `effectiveMaxChunks` → `longTermMemoryMaxChunks` (150) These stay decimal and are out of scope: `longTermMemoryScoreThreshold` (782), the four recall weights (798–825) and `temperature` (1170). ## Minimal fix - Files: `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx` and `.../long-term-memory/ChatSettings.tsx`. - Change: add the existing `integer` prop to the nine `<NumberField>` callers listed above. Don't change `shared-controls.tsx`: its `integer ? Math.round(next) : next` clamp from #1964 already does the rounding. - Regression: extend `tests/long-term-memory-feedback-clarity-ui.regression.mjs` next to the #1964 block. Assert that each of the nine fields (matched by its `value={...}` expression) carries `integer`, and that the six decimal fields don't. - Release: LTM patch bump and rebuild (client bundle, artifact, catalog). ## 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-11-07 16:37:06 +07:00
  • closed this issue
  • added the
    bug
    label
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#1850
No description provided.