cef999c5cf
Review follow-up on the salvaged #89444: - Warn fires only from the conversation-loop pre-API site, reusing the unconditionally computed request_pressure_tokens (zero marginal cost, covers turn-start AND mid-turn growth) — drops the duplicate every-turn estimate the turn-context block paid. - Turn-context block now only RE-ARMS the dedup once the session is back under the window, so warn -> /compress -> regrow warns again (the dedup was previously never cleared with compression disabled). - Char pre-check treats non-string (multimodal) content as over-gate — len() of a part list defeated the 20k char floor (probe: 10 'chars' vs ~70k real tokens) — and compares against the window, not a flat 20k. - Deletes the unreachable get_model_context_length fallback from both sites (context_compressor always exists; its context_length property hard-floors positive; the fallback would have been a synchronous network probe mid-turn that also bypassed config overrides) and the undeduped inline _emit_warning fallback (third copy of the message). - Tests bind the PRODUCTION warn/clear methods (previously a verbatim fake reimplementation left them uncovered) and add dedup, re-arm, no-rearm-while-over, and multimodal-gate coverage.