feat: OAuth provider onboarding path — Codex/Copilot no longer blocks setup (#331)

Fixes bug 2 from issue #329. current_is_oauth flag; confirmation card for OAuth providers; KeyError fix in _build_setup_catalog. 15 new tests, 791 total.
This commit is contained in:
nesquena-hermes
2026-04-12 14:28:16 -07:00
committed by GitHub
parent 7d9d7e7b66
commit 2fc19a8326
7 changed files with 258 additions and 2 deletions

View File

@@ -362,13 +362,23 @@ def _build_setup_catalog(cfg: dict) -> dict:
}
)
# Flag whether the currently-configured provider is OAuth-based (not in the
# API-key flow). The frontend uses this to show a confirmation card instead
# of a key input when the user has already authenticated via 'hermes auth'.
current_is_oauth = current_provider not in _SUPPORTED_PROVIDER_SETUPS and bool(
current_provider
)
return {
"providers": providers,
"unsupported_note": _UNSUPPORTED_PROVIDER_NOTE,
"current_is_oauth": current_is_oauth,
"current": {
"provider": current_provider,
"model": current_model
or _SUPPORTED_PROVIDER_SETUPS[current_provider]["default_model"],
or _SUPPORTED_PROVIDER_SETUPS.get(current_provider, {}).get(
"default_model", ""
),
"base_url": current_base_url,
},
}