fix(setup): use explicit key mapping for returning-user menu dispatch instead of positional index (#3083)
Co-authored-by: ygd58 <buraysandro9@gmail.com>
This commit is contained in:
@@ -3234,12 +3234,17 @@ def run_setup_wizard(args):
|
|||||||
print_info("Exiting. Run 'hermes setup' again when ready.")
|
print_info("Exiting. Run 'hermes setup' again when ready.")
|
||||||
return
|
return
|
||||||
elif 3 <= choice <= 7:
|
elif 3 <= choice <= 7:
|
||||||
# Individual section
|
# Individual section — map by key, not by position.
|
||||||
section_idx = choice - 3
|
# SETUP_SECTIONS includes TTS but the returning-user menu skips it,
|
||||||
_, label, func = SETUP_SECTIONS[section_idx]
|
# so positional indexing (choice - 3) would dispatch the wrong section.
|
||||||
func(config)
|
_RETURNING_USER_SECTION_KEYS = ["model", "terminal", "gateway", "tools", "agent"]
|
||||||
save_config(config)
|
section_key = _RETURNING_USER_SECTION_KEYS[choice - 3]
|
||||||
_print_setup_summary(config, hermes_home)
|
section = next((s for s in SETUP_SECTIONS if s[0] == section_key), None)
|
||||||
|
if section:
|
||||||
|
_, label, func = section
|
||||||
|
func(config)
|
||||||
|
save_config(config)
|
||||||
|
_print_setup_summary(config, hermes_home)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# ── First-Time Setup ──
|
# ── First-Time Setup ──
|
||||||
|
|||||||
Reference in New Issue
Block a user