SIGN IN SIGN UP

fix: handle BudgetExceededError after background compaction re-render (#312901)

* fix: handle BudgetExceededError after background compaction re-render

When the initial render throws BudgetExceededError and a completed
background compaction is applied, the re-render was unprotected. If
the compacted prompt still exceeds the budget (e.g. many MCP tools
consuming token space, or cache breakpoints preventing pruning), the
BudgetExceededError propagated uncaught and crashed the chat with
'No lowest priority node found'.

Now the re-render is wrapped in a try-catch that falls back to
renderWithoutSummarization (full budget, no cache breakpoints) on
BudgetExceededError, with telemetry outcome 'appliedButReRenderFailed'
to track how often this path is hit.

Fixes #311407

* fix: update telemetry for background compaction outcomes and re-render handling
B
Bhavya U committed
d025ee4199fd1de3b3e6468ed2c9eaa058228bd8
Parent: d10a07d
Committed by GitHub <noreply@github.com> on 4/27/2026, 9:31:29 PM