v2.23.0
Added
- The review skips before any LLM call when the diff does not fit the model context window (#1056). Before, an oversized diff went to the provider, which rejected it with HTTP 400. Every agent then failed and the comment said “0 findings, 2 failed agents”. Now the engine compares the estimated input tokens plus the output cap of each agent with a fraction of the model context window. When an agent does not fit, the review skips with a comment that names the agent, the numbers, and
AI_EXCLUDE_PATTERNSas the fix for generated files. The window comes fromcontext_windowinconfig/model-pricing.json, which is set for Sonnet 5.5, Opus 5.5, and Haiku 5.5. A model without it is not checked. - Two new settings control the check.
AI_CONTEXT_WINDOW_MARGIN(context-window-margin, default0.9,0turns it off) sets the fraction.AI_FAIL_ON_CONTEXT_WINDOW(fail-on-context-window, defaultfalse) makes a skip exit 2. The check runs withoutAI_MAX_COST_USD.max-diff-linescounts lines and not tokens, so it cannot protect against this failure.
Changed
- Behavior change: reports now count the pr-summarizer and issue-linker (#1055). Their usage was missing from the token table, the usage line, the high-usage warning, and the
COST_RECONCILEactual. The token table now has a row for each preflight agent that ran. The reported cost and the agent count are higher, andAI_TOKEN_USAGE_WARN_USDcan fire on a run that did not fire it before.
Fixed
- The
COST_RECONCILEdelta prints the right sign (#1055). A delta of -$0.3070 printed as$-1.6930. It now prints-$0.3070.
Known limits
- A provider “prompt is too long” error that gets past the estimate is still reported as failed agents and not as a skip.
context_windowis set only for the three Claude 5.5 models. Add it to other entries inconfig/model-pricing.jsonto cover them.
See CHANGELOG.md for full technical detail.