-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Summary
When memory.compression.probe is enabled and a compaction probe HardFail occurs, the /compact command still displays "Context compacted successfully." to the user, even though the compaction was rejected and original messages were preserved.
Root Cause
In crates/zeph-core/src/agent/mod.rs (around line 2133), the /compact handler matches Ok(_) without distinguishing between CompactionOutcome::Compacted and CompactionOutcome::ProbeRejected:
match self.compact_context().await {
Ok(_) => {
let _ = self.channel.send("Context compacted successfully.").await;
}
Err(e) => {
let _ = self.channel.send(&format!("Compaction failed: {e}")).await;
}
}When compact_context() returns Ok(CompactionOutcome::ProbeRejected), the user sees the success message despite compaction being rejected.
Reproduction
- Enable compaction probe in config:
[memory.compression.probe] enabled = true threshold = 0.6 hard_fail_threshold = 0.35
- Have a session with simple fact-saving turns (not complex enough for anchored summary to capture)
- Run
/compact
Log output (WARN):
WARN zeph_core::agent::context::summarization: compaction probe HARD FAIL — keeping original messages score=0.0 threshold=0.35
User sees (incorrect):
Context compacted successfully.
Expected Behavior
When probe HardFail rejects compaction, the user should see a message like:
Compaction rejected: summary quality too low (probe hard fail, score=0.0). Original context preserved.
Probe Dump Analysis
From 0011-compaction-probe.json (CI-21 session):
"score": 0.0,"verdict": "HardFail"- All 3 questions answered "UNKNOWN" — summary (anchored) captured high-level decisions but not specific fact content
- Compaction correctly rejected by probe, but user messaging is misleading
Additional Observation
The anchored summarization format (session_intent, decisions_made, files_modified, etc.) is not designed to preserve specific factual content from simple fact-saving sessions. The probe correctly detects this lossiness, confirming the probe's detection logic is working. The only issue is the user-facing message.
Fix Suggestion
Match on CompactionOutcome::ProbeRejected in mod.rs and send an appropriate user message. The compact_context() return type already supports this variant.
Test Evidence
- Version: v0.16.0 (post-commit 15b3f07)
- Config:
.local/config/testing-ci21.toml - Debug dump:
.local/testing/debug/ci21/1774023117/0011-compaction-probe.json - Log:
.local/testing/debug/session-ci21-probe.log - CI session: CI-21 (2026-03-20)