Skip to content

fix: salvage batch — compaction guidance, memory authority, cache eviction after compression#20579

Merged
kshitijk4poor merged 1 commit into
mainfrom
fix/compaction-salvage-batch-may2026
May 6, 2026
Merged

fix: salvage batch — compaction guidance, memory authority, cache eviction after compression#20579
kshitijk4poor merged 1 commit into
mainfrom
fix/compaction-salvage-batch-may2026

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

Salvage three small compaction/compressor bug fixes from community PRs onto
current main. All applied as clean patches with contributor credit preserved.

Changes

Original PR Author Fix Files
#20027 @LeonSGP43 Fix /compact/compress in context-overflow guidance (closes #20020). Two locations: _normalize_empty_agent_response() and the exception handler return path. gateway/run.py
#18767 @MacroAnarchy Evict cached agent after compression so system prompt refreshes with latest skills/memory/SOUL.md. Two call sites: session hygiene finally + manual /compress finally. gateway/run.py
#17380 @vominh1919 Preserve memory authority across compaction. Changed "background reference data" → "authoritative reference data" in SUMMARY_PREFIX, compression note, and memory block. Backward-compatible regex. agent/context_compressor.py, agent/memory_manager.py

Excluded from this batch

Test plan

tests/gateway/test_compress_command.py    — 4 passed
tests/agent/test_context_compressor.py    — 68 passed
tests/agent/test_memory_provider.py       — 68 passed
tests/agent/test_streaming_context_scrubber.py — 11 passed
───────────────────────────────────────────
Total: 151 passed, 0 failed

Closes #20020

…ction after compression

- Fix /compact → /compress in context-overflow tips (closes #20020)
- Evict cached agent after session hygiene and /compress so system
  prompt refreshes with current SOUL.md, memory, and skills
- Restore memory authority across compaction: change 'informational
  background data' to 'authoritative reference data' in memory block
  and SUMMARY_PREFIX, with backward-compatible regex

Based on:
- PR #20027 by @LeonSGP43
- PR #18767 by @MacroAnarchy
- PR #17380 by @vominh1919

PR #17121 boundary marker fix already merged to main (2eef395).
PR #9262 user-message anchoring already on main via _ensure_last_user_message_in_tail().
@kshitijk4poor kshitijk4poor merged commit aa88dcc into main May 6, 2026
9 of 10 checks passed
@kshitijk4poor kshitijk4poor deleted the fix/compaction-salvage-batch-may2026 branch May 6, 2026 05:33
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]: Compress command tips wrong

1 participant