fix: lazy debug logging in clear_tool_uses; remove unused context_management constants

Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
Cursor Agent 2026-05-25 13:10:18 +00:00
parent 3097f5160c
commit b976871453
No known key found for this signature in database
2 changed files with 1 additions and 3 deletions

View file

@ -1,8 +1,6 @@
"""Constants for the in-gateway context-management polyfill."""
CLEAR_TOOL_USES_EDIT_TYPE = "clear_tool_uses_20250919"
CLEAR_THINKING_EDIT_TYPE = "clear_thinking_20251015"
COMPACT_EDIT_TYPE = "compact_20260112"
DEFAULT_INPUT_TOKENS_TRIGGER = 100_000
DEFAULT_KEEP_TOOL_USES = 3

View file

@ -177,7 +177,7 @@ def apply_clear_tool_uses_20250919(
ids_to_clear.discard(last_completed_id)
edited, cleared_count = _clear_tool_results(messages, ids_to_clear)
verbose_logger.debug(f"context_management polyfill: edited: {edited}")
verbose_logger.debug("context_management polyfill: edited: %s", edited)
if cleared_count == 0:
return messages, None