Commit Graph

2 Commits

Author SHA1 Message Date
unsupportedpastels
a212421dbd fix(context): keep the fallback source on the compressor, and through MoA presets
The per-route record held only the latest lookup, so a second session that
detected the same window on a route cleared the label of an agent still
running on its earlier default. The compressor now keeps the source of its
own lookup (last_defaulted_context_length, read right after it resolves) and
the agent label reads that.

A nested lookup that defaults (a MoA preset's aggregator) now marks the outer
resolution too, so the preset's window keeps "fallback".

Addresses Greptile review on #148801 (f6e7d756).
2026-11-04 12:56:04 -05:00
unsupportedpastels
0b388277f9 fix(context): read the fallback label from the resolver, and label /status and /context
The fallback marker re-derived the resolver's answer from a few local
sources, so a window a custom endpoint reported through /models (or a
local probe, provider profile, live catalog) read as "fallback" whenever
it equalled the default. Its 60s memo was also keyed without the profile
home, so one multiplexed profile's verdict labelled another's window.

get_model_context_length now records when it ended on a static default
(the generic 256K or Bedrock's 128K) per (profile home, model, base_url),
and the marker reads that record. The memo is gone.

Gateway /model drops the configured pin for a changed route before both
the number and its label, through the same helper resolve_display_context_length
uses, so a discarded 128K pin no longer shows "(pinned)" over a fallback.
/status and /context now carry the same label as /usage for resident
agents and non-resident sessions.

Addresses Greptile review on #148801.
2026-11-04 12:56:04 -05:00