Skip to content

Preserve context_length when switching desktop models - #41965

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/41944-preserve-context-length
Open

Preserve context_length when switching desktop models#41965
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/41944-preserve-context-length

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • preserve an explicit override when the desktop model picker switches the main model
  • keep the existing provider/base_url reconciliation logic unchanged
  • add a regression test covering a fresh Ollama session with a custom context length

Testing

  • uv run --frozen --extra dev pytest tests/hermes_cli/test_web_server.py -k set_model_assignment_preserves_context_length_override
  • uv run --frozen ruff check hermes_cli/web_server.py tests/hermes_cli/test_web_server.py
  • git diff --check

Closes #41944

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 8, 2026
@alt-glitch alt-glitch added the comp/dashboard Web dashboard / control panel UI (dashboard/, landing) label Jun 26, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the desktop model-assignment path. The premise is still valid on current main: hermes_cli/web_server.py:1141 unconditionally removes model.context_length, despite the documented highest-priority config override in website/docs/integrations/providers.md:1141 and resolver behavior in agent/model_metadata.py:2051-2053.

Problems

  • The current direct helper contract at tests/hermes_cli/test_web_server.py:3162-3168 still asserts that context_length is removed. The added endpoint regression does not replace that assertion, so the updated production behavior would leave contradictory test expectations.
  • GitHub currently reports the branch as conflicting. The helper has since grown endpoint-key handling at hermes_cli/web_server.py:1130-1140; preserve that logic while applying the context override change.

Suggested changes

  • Update the direct helper test to assert retention of an explicit context_length, alongside the new endpoint-level regression.

Automated hermes-sweeper review.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Desktop] Model picker clears model.context_length when switching models in a fresh session

3 participants