Skip to main content

Module diff_truncation

Module diff_truncation 

Source

Constants§

CLAUDE_MAX_PROMPT_SIZE
Maximum prompt size for Claude-based agents.
GLM_MAX_PROMPT_SIZE
Maximum prompt size for GLM-like agents (GLM, Zhipu, Qwen, DeepSeek).
MAX_SAFE_PROMPT_SIZE
Maximum safe prompt size in bytes before pre-truncation.

Functions§

effective_model_budget_bytes
model_budget_bytes_for_agent_name
Get the maximum safe prompt size for a specific agent.
truncate_diff_if_large
Truncate diff if it’s too large for agents with small context windows.
truncate_diff_to_model_budget
truncate_lines_to_fit