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_PATTERNS as the fix for generated files. The window comes from context_window in config/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, default 0.9, 0 turns it off) sets the fraction. AI_FAIL_ON_CONTEXT_WINDOW (fail-on-context-window, default false) makes a skip exit 2. The check runs without AI_MAX_COST_USD. max-diff-lines counts 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_RECONCILE actual. The token table now has a row for each preflight agent that ran. The reported cost and the agent count are higher, and AI_TOKEN_USAGE_WARN_USD can fire on a run that did not fire it before.

Fixed

  • The COST_RECONCILE delta 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_window is set only for the three Claude 5.5 models. Add it to other entries in config/model-pricing.json to cover them.

See CHANGELOG.md for full technical detail.