Skip to content

fix(cli): initialize ctx_len before compact banner path - #4409

Closed
el-analista wants to merge 1 commit into
NousResearch:mainfrom
el-analista:fix/ctx-len-compact-banner
Closed

fix(cli): initialize ctx_len before compact banner path#4409
el-analista wants to merge 1 commit into
NousResearch:mainfrom
el-analista:fix/ctx-len-compact-banner

Conversation

@el-analista

Copy link
Copy Markdown
Contributor

Summary

  • ctx_len was only assigned inside the else (non-compact) branch of show_banner() but referenced unconditionally after the if/else, causing UnboundLocalError when the terminal is narrow or --compact is set.
  • Moved ctx_len = None before the branch so it's always initialized.

Test plan

  • Run hermes in a terminal narrower than 80 columns (triggers compact banner)
  • Run hermes --compact
  • Confirm no UnboundLocalError crash on startup

ctx_len was only assigned inside the else (non-compact) branch but
referenced unconditionally after the if/else, causing an
UnboundLocalError when the terminal is narrow or --compact is set.
@el-analista
el-analista marked this pull request as ready for review April 1, 2026 07:21
@teknium1

teknium1 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Fixed in PR #4411, which cherry-picked the implementation from #4334. Thanks for the contribution @el-analista!

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.

2 participants