Skip to content

fix(core): distinguish probe rejection from success in /compact handler (#2058)#2064

Merged
bug-ops merged 2 commits intomainfrom
fix-2058
Mar 20, 2026
Merged

fix(core): distinguish probe rejection from success in /compact handler (#2058)#2064
bug-ops merged 2 commits intomainfrom
fix-2058

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 20, 2026

Summary

When memory.compression.probe is enabled and a compaction probe HardFail occurs, the /compact command now correctly shows "Compaction rejected: summary quality below threshold. Original context preserved." instead of the misleading "Context compacted successfully." message.

Changes

  • Fix: Updated the /compact handler in crates/zeph-core/src/agent/mod.rs to explicitly match on CompactionOutcome variants instead of blindly accepting all Ok(_) results
  • Message on success: "Context compacted successfully." (for Compacted | NoChange)
  • Message on rejection: "Compaction rejected: summary quality below threshold. Original context preserved." (for ProbeRejected)
  • Updated: CHANGELOG.md entry added

Testing

  • ✅ All pre-commit checks pass: cargo +nightly fmt --check, cargo clippy, 6090 tests
  • ✅ Code review: Approved (fix is minimal, exhaustive match on all CompactionOutcome variants)
  • ✅ Testing validation: Approved (existing test coverage sufficient, no regressions)
  • ✅ Live reproduction verified in CI-23: probe score=0.75, hard_fail_threshold=0.90 → user now sees correct rejection message

Issue

Closes #2058

Related

@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/S Small PR (11-50 lines) labels Mar 20, 2026
bug-ops added 2 commits March 20, 2026 20:25
…er (#2058)

Match CompactionOutcome::ProbeRejected separately so the user sees
"Compaction rejected: summary quality below threshold." instead of
the misleading "Context compacted successfully." when the compaction
probe hard-fails.
@bug-ops bug-ops enabled auto-merge (squash) March 20, 2026 19:25
@bug-ops bug-ops merged commit 7f14733 into main Mar 20, 2026
25 checks passed
@bug-ops bug-ops deleted the fix-2058 branch March 20, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(compact): /compact shows 'success' message when probe HardFail rejects compaction

1 participant