1 Commits

Author SHA1 Message Date
teknium1
8e180c69f6 feat: label a model.context_length pin and warn once when it disagrees with the provider
model.context_length short-circuits get_model_context_length ahead of every
provider source, but nothing told the user the number they saw was their own
pin rather than provider metadata (#66168). Keep the pin semantics (custom
endpoints depend on it) and make it visible instead:

- agent/context_pin.py: is_context_pinned / context_pin_suffix for renderers,
  and warn_once_on_pin_disagreement, called from _resolve_context_length at
  agent init. The advertised value comes from LOCAL sources only (endpoint
  cache, models.dev disk cache, hardcoded catalog) so the check never adds a
  network probe or latency to startup; one warning per (model, pin) per process.
- "(pinned)" label on every CLI surface that renders the window: welcome
  banner, /model switch summary, /usage current-context line, wide status bar.
- No new config key or env var; the numeric value used is unchanged.

Fixes #66168
2026-09-19 10:28:34 -07:00