The gateway session line printed "◆ Context: 128K tokens (detected)" for a Bedrock
model no source knew. _resolve_gateway_model_context recognised only the generic 256K
DEFAULT_FALLBACK_CONTEXT as a default, so Bedrock's static 128K was reported as
detected. The CLI surfaces showed the number with no source at all.
agent/context_pin.py already labels a model.context_length pin "(pinned)" on those
surfaces (#66168). This commit extends the same helper with a "fallback" marker:
- is_fallback_context_length(window, model=, provider=, base_url=) is True only when
the window equals the resolver's default for that route and no local source knows
the model. On Bedrock the default is BEDROCK_DEFAULT_CONTEXT_LENGTH, and the checks
are the table/family step, a provider-confirmed cache row and model_overrides. The
generic route uses DEFAULT_FALLBACK_CONTEXT, the catalog, models.dev and
custom_providers. It does only local reads, memoised for 60s because the status bar
repaints often. It fails open and never probes.
- Labelled surfaces: the gateway session line (via context_source "default", now
worded "fallback, not a detected limit"), CLI and gateway /usage, the wide status
bar (new cli.status_bar.ctx_fallback key in all 17 locales), the welcome banner,
and the CLI and gateway /model switch summary.
No new config key. The override is unchanged: model.context_length, or
model_overrides.<provider>.<model>.context_window.