fix: setup wizard skipping provider selection on fresh install

The is_existing check included 'get_config_path().exists()' which is
always True after installation (the installer copies config.yaml from
the template). This caused the wizard to enter quick mode, which
skips provider selection entirely — leaving hermes non-functional.

Fix: only consider it an existing installation when an actual
inference provider is configured (OPENROUTER_API_KEY, OPENAI_BASE_URL,
or an active OAuth provider). Fresh installs now correctly show the
full setup flow with provider selection.
This commit is contained in:
teknium1
2026-03-02 22:20:45 -08:00
parent 245c766512
commit 4cc431afab

View File

@@ -390,11 +390,17 @@ def run_setup_wizard(args):
config = load_config()
hermes_home = get_hermes_home()
# Check if this is an existing installation with config (any provider or config file)
# Check if this is an existing installation with a provider configured.
# Just having config.yaml is NOT enough — the installer creates it from
# a template, so it always exists after install. We need an actual
# inference provider to consider it "existing" (otherwise quick mode
# would skip provider selection, leaving hermes non-functional).
from hermes_cli.auth import get_active_provider
active_provider = get_active_provider()
is_existing = (
get_env_value("OPENROUTER_API_KEY") is not None
or get_env_value("OPENAI_BASE_URL") is not None
or get_config_path().exists()
or active_provider is not None
)
# Import migration helpers