Skip to content

fix(memory): prevent oldest entry from dropping in STLTMemory#191

Open
Harshitmehra-270709 wants to merge 2 commits intomesa:mainfrom
Harshitmehra-270709:fix/issue-186-memory-loss
Open

fix(memory): prevent oldest entry from dropping in STLTMemory#191
Harshitmehra-270709 wants to merge 2 commits intomesa:mainfrom
Harshitmehra-270709:fix/issue-186-memory-loss

Conversation

@Harshitmehra-270709
Copy link

Fixes #186

Describe the bug
STLTMemory._process_step_core() was previously prematurely popping the oldest entry from the short_term_memory queue before the LLM could summarize it via _update_long_term_memory(). This resulted in the oldest memory being completely lost.

The Solution

  • Defer the popleft() call to occur exactly after the _update_long_term_memory() method calculates the new summary in both process_step and �process_step.
  • Added a definitive regression test using the repro steps from the issue description to verify the behavior directly against the LLM mock call arguments.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d14c24a7-78d9-4080-9907-6ee964b7bf80

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@IlamaranMagesh IlamaranMagesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already PRs and issues opened on this. Please look into it #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: STLTMemory silently drops the oldest memory entry during consolidation

2 participants