Repository navigation
fix(long-term-memory): 1.4.11 — reserve prompt overhead and refill dropped memories - #1256
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (2)
📒 Files selected for processing (14)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughLong-Term Memory 1.4.11 adjusts prompt and retrieval budgeting. The serializer considers later chunks when a candidate does not fit. Generation injection reserves estimated prompt overhead, and package metadata and release notes are updated. ChangesRecall budget and release
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant prepareGenerationLongTermMemory
participant prompt
participant retrieveLongTermMemory
participant applyLtmBudget
prepareGenerationLongTermMemory->>prompt: Estimate fixed prompt overhead
prepareGenerationLongTermMemory->>retrieveLongTermMemory: Pass adjusted budget and normalized estimate option
retrieveLongTermMemory->>applyLtmBudget: Apply budget to retrieval candidates
applyLtmBudget-->>retrieveLongTermMemory: Return selected chunks and budget exhaustion status
retrieveLongTermMemory-->>prepareGenerationLongTermMemory: Return retrieval result
prepareGenerationLongTermMemory->>prompt: Serialize chunks using configured budget
prompt-->>prepareGenerationLongTermMemory: Return rendered prompt or null
Merge Risk: ⚪ Minimal · up to The recall-budget change is ready to merge after normal package and catalog validation. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Full details: Docstring CoverageExplanation Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/budget.tstypescript-eslint does not support TS 7.0. Oops! Something went wrong! :( ESLint: 10.11.0 Error: typescript-eslint does not support TS 7.0. packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/generation-injection.tsESLint skipped: the matched ESLint configuration already failed (config-incompatibility). packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/prompt.tsESLint skipped: the matched ESLint configuration already failed (config-incompatibility).
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Linked issue
Closes #1252
Why this change
no_matches, writing a zero-match injection receipt instead of a prompt-budget skip.What changed
prompt.ts: extractedrenderLongTermMemoryPrompt, addedestimateLongTermMemoryPromptOverheadandformatLongTermMemoryPromptBullet, and rewroteserializeLongTermMemoryPromptto re-fit each candidate against the rendered prompt and skip an overflowing chunk instead of popping the tail.generation-injection.ts: reserves the fixed prompt overhead in the retrieval budget (guarding the case where the overhead alone fills it), requests the prompt-normalized token estimate, and recordsskipped/prompt_budgetwhen the reserved budget rejected every candidate rather than writing a zero-match receipt.budget.ts/retrieval.ts: optional prompt-normalized estimate plus a debug-independentbudgetExhaustedsignal; defaults preserve search and reconciliation callers.tests/long-term-memory-runtime.regression.ts: a/b/c refill case, legacysummary:chunk case, and a budget-exhausted receipt-preservation case.long-term-memory1.4.11: manifest,server.mjs, artifact ZIP and catalog lane entries; changelog entry added.Package and security impact
long-term-memoryValidation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdManual verification notes
On
8383abe57f70eca2a0da875bbffb5ba16f2282d5(pushed SHA), withMARINARA_AGENTS_ROOTandMARINARA_ENGINE_ROOTset:test-fast.sh(Prettier, ESLint,git diff --check): exit 0.npm run typecheck:packages: pass ("long-term-memory: no syntax errors, undefined names or unresolved modules").test-ltm.sh runtime,test-ltm.sh routes,test-ltm.sh debug-log: pass; runtime includes the new refill, legacysummary:and budget-exhausted cases.test-ltm.sh installation: pass ("Long-Term Memory 1.4.11 installation: install, offline restart, backup inclusion, uninstall, reinstall, and durable-byte preservation ok") against the exact committed ZIP.node scripts/test-catalog-lanes.mjs,node scripts/validate-package-locales.mjs,node scripts/validate-catalog.mjs,node scripts/tests/catalog-release-notes.regression.mjs: pass.assertPublishProofverified unchanged on final HEAD immediately before push.Documentation impact
UI evidence (if applicable)
None — server-side recall selection and prompt assembly change; no client UI surface.
Summary by CodeRabbit