turn.usage.input accumulates across steps, so several fitting steps could sum past the window and misclassify a later unrelated InvalidRequest. Use the last completed step's input (the live context size, same basis as the reported turn token usage) instead.
Imamuzzaki Abu Salam committed on 10/23/2026, 1:11:23 AMparent073cb01
3 files changedLine totals unavailable