Skip to content

fix: recompute runtime context length across runtime switches - #18868

Closed
leavrcn wants to merge 1 commit into
NousResearch:mainfrom
leavrcn:fix/runtime-config-context-refresh
Closed

leavrcn wants to merge 1 commit into
NousResearch:mainfrom
leavrcn:fix/runtime-config-context-refresh

Conversation

@leavrcn

@leavrcn leavrcn commented May 2, 2026

Copy link
Copy Markdown

Summary

  • add a shared helper to resolve runtime _config_context_length
  • recompute _config_context_length in switch_model(), _try_activate_fallback(), and _restore_primary_runtime()
  • keep top-level model.context_length precedence unchanged
  • add focused regression coverage for init precedence, runtime switch, fallback, and restore

Test Plan

  • pytest -q tests/run_agent/test_switch_model_context.py tests/run_agent/test_compressor_fallback_update.py tests/run_agent/test_runtime_context_length_refresh.py
  • pytest -q tests/run_agent/test_provider_fallback.py tests/run_agent/test_switch_model_fallback_prune.py tests/hermes_cli/test_custom_provider_context_length.py
  • pytest -q tests/run_agent/test_switch_model_context.py tests/run_agent/test_compressor_fallback_update.py tests/run_agent/test_runtime_context_length_refresh.py tests/hermes_cli/test_custom_provider_context_length.py tests/run_agent/test_provider_fallback.py tests/run_agent/test_switch_model_fallback_prune.py

Notes

  • excluded local-only files from the commit, including .hermes/, docs/, and tests/gateway/test_run_progress_cards.py

@leavrcn
leavrcn force-pushed the fix/runtime-config-context-refresh branch from 9df8e02 to 6336952 Compare May 2, 2026 15:21
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels May 2, 2026
@leavrcn

leavrcn commented Jul 12, 2026

Copy link
Copy Markdown
Author

Closing — superseded by active work under PR #50384. Will reopen if needed.

@leavrcn leavrcn closed this Jul 12, 2026
@leavrcn
leavrcn deleted the fix/runtime-config-context-refresh branch September 7, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants