Skip to content

Fix: Remove notification for auto prune tool and disable threshold-based proactive pruning#24

Merged
tuanhung303 merged 4 commits intomasterfrom
feature/auto-prune-thinking
Feb 18, 2026
Merged

Fix: Remove notification for auto prune tool and disable threshold-based proactive pruning#24
tuanhung303 merged 4 commits intomasterfrom
feature/auto-prune-thinking

Conversation

@tuanhung303
Copy link
Owner

Summary

This PR addresses two issues with the proactive pruning functionality:

  1. Removes user notification for auto-prune tool since notifications should only be shown when the agent actively calls context_prune
  2. Temporarily disables threshold-based proactive pruning due to calculation accuracy issues that could lead to unintended aggressive pruning

Changes Made

  • Removed notification sending in auto-prune tool in lib/hooks.ts
  • Added early return in lib/strategies/proactive-prune.ts to disable the feature until calculation accuracy is improved
  • Updated configuration schema and defaults to indicate the feature is currently disabled
  • Fixed package version that was incorrectly downgraded
  • Skipped proactive pruning tests since the feature is intentionally disabled

Testing

  • Updated unit tests to skip proactive pruning tests since the feature is currently disabled
  • All remaining tests pass
  • The changes ensure no unintended behavior while the proactive pruning algorithm is being refined

…request errors

ACP was replacing pruned ToolParts with TextParts, breaking the tool-call/tool-result
pairing that Anthropic's API requires. This caused 'Improperly formed request' errors
at high context usage. Now prune only replaces state.output while keeping the ToolPart
intact. Also adds empty-parts guard in filterStepMarkers and uses provider-reported
token counts for accurate context pressure measurement.
…cies

- Added early return in proactivePrune function to disable threshold-based pruning
- Updated configuration schema to indicate thresholds are currently disabled
- Updated defaults documentation to reflect disabled state
- Preserved all other functionality while eliminating problematic calculations
@tuanhung303 tuanhung303 merged commit b07308f into master Feb 18, 2026
3 checks passed
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.

1 participant