[Bug] Gemini 4 Hydrogen High 15m44s "window " infinite loop wasted ~16-20% 5h + 4% weekly Ultra quota (Trace Pe8Ka-qDF8KQ3boPmu_GwAM)

Runaway repetition like this is worth catching on the client side as well, since the quota is spent before any manual cancel. A guard can watch the stream for an n-gram repeated past a threshold, or output tokens past a per-step cap with no tool call, and stop the step. A test for the guard: replay a recorded stream that repeats one token and assert that the step ends with a loop error, that billed output stays under the cap, and that the session records the step as failed rather than completed. Your trace and step index give the team what they need to reproduce it.