Skip to content

Fix UnboundLocalError in show_banner() for compact mode - #4392

Closed
andyg5000-agent wants to merge 1 commit into
NousResearch:mainfrom
andyg5000-agent:fix/unboundlocalerror-show-banner
Closed

Fix UnboundLocalError in show_banner() for compact mode#4392
andyg5000-agent wants to merge 1 commit into
NousResearch:mainfrom
andyg5000-agent:fix/unboundlocalerror-show-banner

Conversation

@andyg5000-agent

Copy link
Copy Markdown

Fixes a bug where Hermes CLI crashes with UnboundLocalError when using compact banner mode.

The ctx_len variable was only defined inside the else block when
use_compact=False, but accessed unconditionally on line 2201 for
the context length warning. This caused a crash when using compact
banner mode.

Fix: Move ctx_len initialization before the if/else block so it
is always defined regardless of banner style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant