Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an explicit configuration switch to disable working-memory summarization and enforces validation on the summarization threshold to prevent invalid configurations (addressing issue #193).
Changes:
- Introduces
enable_working_memory_summarization(env:ENABLE_WORKING_MEMORY_SUMMARIZATION, defaulttrue) to skip summarization during working-memory PUT operations. - Validates
summarization_thresholdto ensure it is within(0, 1], failing fast with a guidance message when invalid. - Adds unit + integration tests covering the new flag behavior and threshold validation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agent_memory_server/config.py | Adds enable_working_memory_summarization and validates summarization_threshold range at settings load time. |
| agent_memory_server/api.py | Skips _summarize_working_memory() entirely when summarization is disabled. |
| tests/test_summarization.py | Adds unit tests for threshold validation and enable/disable flag default/override behavior. |
| tests/test_api.py | Adds an integration-style test ensuring PUT preserves messages and context when summarization is disabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vishal-bala
reviewed
Mar 18, 2026
Contributor
vishal-bala
left a comment
There was a problem hiding this comment.
LGTM! There's one bot comment (that I added a follow-up comment on) that I think would be good to address, and a couple of very minor ones from me.
abrookins
approved these changes
Mar 18, 2026
Collaborator
abrookins
left a comment
There was a problem hiding this comment.
LGTM, thanks for plugging that!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pr addresses: #193
Description
This PR adds an explicit configuration flag to disable working-memory summarization and validates the SUMMARIZATION_THRESHOLD setting to prevent misconfiguration.
Problem
Previously, users who wanted to disable working-memory summarization had no clean way to do so. Setting SUMMARIZATION_THRESHOLD to extreme values (like 0 or 100.0) could
cause undefined behavior or subtle bugs. There was no fail-fast validation for invalid threshold values.
Solution
Changes
Usage
Disable summarization
ENABLE_WORKING_MEMORY_SUMMARIZATION=false
Enable summarization (default)
ENABLE_WORKING_MEMORY_SUMMARIZATION=true
SUMMARIZATION_THRESHOLD=0.7 # Must be in (0, 1]
Testing
Breaking Changes
None. Default behavior is unchanged (enable_working_memory_summarization=true).
Related
Closes #193
Note
Medium Risk
Behavior of
PUT /v1/working-memory/{session_id}can now change significantly based on config, and strictersummarization_thresholdvalidation may cause startup failures for previously accepted (invalid) environment values.Overview
Adds an explicit
enable_working_memory_summarizationsetting (defaultTrue) and makes_summarize_working_memoryinapi.pyreturn early when it’s disabled, preserving all messages and skipping summary/context trimming.Tightens configuration by validating
summarization_thresholdto(0, 1]via Pydantic field constraints, and adds tests covering the new flag, threshold validation, and an API-level case ensuring summarization is skipped when disabled.Written by Cursor Bugbot for commit 8c2c4bc. This will update automatically on new commits. Configure here.