Skip to content

[Bug]: Custom providers lack context length auto-detection when saved via /model command #2513

@InB4DevOps

Description

@InB4DevOps

Bug Description

Summary:

When users save a custom provider using the /model command without specifying a context length, the system doesn't automatically detect and display what context length was actually used. This leaves users uncertain about whether their custom provider has a short or long context window, which is critical for prompt caching behavior.

Impact:

  • Users cannot easily verify if their custom provider has adequate context window
  • Prompt caching may be less effective than expected
  • No visual feedback distinguishes between auto-detected and default context lengths

Steps to Reproduce

run hermes model
select a custom provider
do not enter a context length

Expected Behavior

After saving a custom provider without a context length, the system should:

  1. Attempt to auto-detect the context length based on the model name
  2. Display the detected context length to the user
  3. Fall back to a sensible default (128K tokens) if detection fails
  4. Indicate visually when the default was used vs. when auto-detection succeeded

Actual Behavior

Users who save a custom provider without specifying context length have no feedback on what context length is being used. This can lead to unexpected prompt caching behavior and higher token costs.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Operating System

Debian 13.4

Python Version

3.13.3

Hermes Version

0.4

Relevant Logs / Traceback

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions