github nesquena/hermes-webui v0.50.263
v0.50.263 — Context-window indicator hotfix

latest releases: v0.50.266, v0.50.265, v0.50.264...
3 hours ago

v0.50.263 — Context-window indicator hotfix

Fixes the misleading "100" / "890% used (context exceeded)" indicator on older sessions.

Fixed

  • Context-window indicator broken on older sessions (#1436) — sessions that pre-date #1318 (when context_length was added to Session) returned context_length=0 from /api/session, which combined with two cascading frontend fallbacks rendered the ring as 100 and the tooltip as 890% used (context exceeded), 1.2M / 131.1k tokens used. #1356 fixed the same symptom on the live SSE path but missed the GET /api/session load path.

    Two-layer fix:

    • Backend (api/routes.py) — when persisted context_length is 0, resolve via agent.model_metadata.get_model_context_length() using the session's model. Mirrors the SSE-path fallback in api/streaming.py:2333-2342. Includes empty-model guard to avoid the 256K default-for-unknown trap.
    • Frontend (static/ui.js:1269) — drop the usage.input_tokens fallback for promptTok. Cumulative input_tokens is fundamentally wrong for "context window % used" — it sums input across all turns. Older sessions without last_prompt_tokens now render · + "tokens used" (honest no-data) on the ring instead of a misleading >100% percentage.

    Empirical scope on the dev server before the fix: 23 of 75 sessions were rendering >100%. After: every previously-broken session resolves correctly; healthy sessions are unaffected.

    10 regression tests in tests/test_issue1436_context_indicator_load_path.py pin both layers + the empty-model edge case + exception-swallowing on older agent builds.

    Reported by @AvidFuturist.

Stats

  • PR: #1437 (self-built, independently reviewed by @nesquena with a 6-scenario behavioral harness + edge-case matrix)
  • Files: 4 (api/routes.py, static/ui.js, tests/test_issue1436_context_indicator_load_path.py, CHANGELOG.md)
  • Diff: +328/-3
  • Tests: 3658 passing (+10 new), 0 failures

Don't miss a new hermes-webui release

NewReleases is sending notifications on new releases.