mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-29 18:46:59 +00:00
fix: replace RuntimeError with graceful degradation for unverified LM Studio loads
Salvage of PR #52188. The original PR raised RuntimeError when LM Studio load was rejected or unverifiable, which would abort agent startup on transient network failures. Replace with logger.warning + fallback to configured context length, preserving the old graceful-degradation behavior.
This commit is contained in:
parent
8c12fa7cf0
commit
f1eef85877
2 changed files with 5 additions and 5 deletions
|
|
@ -2280,9 +2280,9 @@ def init_agent(
|
|||
_config_context_length
|
||||
)
|
||||
if agent._lmstudio_load_was_unverified(_lmstudio_runtime_context_length):
|
||||
raise RuntimeError(
|
||||
_ra().logger.warning(
|
||||
"LM Studio model activation was rejected or completed without a "
|
||||
"verifiable active context length; agent startup aborted"
|
||||
"verifiable active context length; falling back to configured context"
|
||||
)
|
||||
_effective_context_length = agent._effective_lmstudio_context_length(
|
||||
_config_context_length,
|
||||
|
|
|
|||
|
|
@ -2341,10 +2341,10 @@ def switch_model(agent, new_model, new_provider, api_key='', base_url='', api_mo
|
|||
_destination_context_intent
|
||||
)
|
||||
if agent._lmstudio_load_was_unverified(_runtime_context_length):
|
||||
_restore_snapshot()
|
||||
raise RuntimeError(
|
||||
logger.warning(
|
||||
"LM Studio model activation was rejected or completed without a "
|
||||
"verifiable active context length; model switch aborted"
|
||||
"verifiable active context length during model switch; continuing "
|
||||
"with configured context"
|
||||
)
|
||||
_effective_context_length = agent._effective_lmstudio_context_length(
|
||||
_destination_context_intent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue