Skip to content

fix: surface provider-scoped context length in gateway session info#15668

Open
guantik-gm wants to merge 4 commits into
NousResearch:mainfrom
guantik-gm:fix/gateway-session-info-context-length
Open

fix: surface provider-scoped context length in gateway session info#15668
guantik-gm wants to merge 4 commits into
NousResearch:mainfrom
guantik-gm:fix/gateway-session-info-context-length

Conversation

@guantik-gm

@guantik-gm guantik-gm commented Apr 25, 2026

Copy link
Copy Markdown

Summary

  • make GatewayRunner._format_session_info() reuse the provider compatibility layer when top-level model.context_length is absent
  • surface per-model context_length from providers: / custom_providers: in the gateway session-info banner
  • add regression coverage for both config shapes in tests/gateway/test_session_info.py

Problem

The gateway /reset / session-info banner only read top-level model.context_length, so configs that stored context under provider-scoped per-model entries (for example providers.<name>.models.<model>.context_length) could incorrectly fall back to the default 128K display even though runtime paths already honored the configured value.

Test Plan

  • python -m pytest tests/gateway/test_session_info.py -q
  • result: 11 passed

Notes

  • preserves existing behavior for top-level model.context_length
  • keeps fallback/default messaging unchanged when no config override is available

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #10690, #5096, #8240, #14382 — all fix the same gateway session-info banner not reading provider-scoped context_length. Consider consolidating.

@nwang783

Copy link
Copy Markdown

I checked the related PRs called out above (#10690, #5096, #8240, #14382). They do appear to be solving the same user-visible bug family: the gateway session-info banner not surfacing the provider-scoped context_length correctly.

I don't see a reviewer-blocking code issue in this PR from that comment alone, but I do think we should consolidate before merge so we don't land the same fix multiple times with slightly different implementations/tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants