diff --git a/api/providers.py b/api/providers.py index bf13cf1a..de038552 100644 --- a/api/providers.py +++ b/api/providers.py @@ -52,8 +52,10 @@ _PROVIDER_ENV_VAR: dict[str, str] = { # through the Hermes CLI, not via API keys. The WebUI cannot set these. _OAUTH_PROVIDERS = frozenset({ "copilot", - "openai-codex", + "copilot-acp", "nous", + "openai-codex", + "qwen-oauth", }) # SECTION: Helper functions @@ -310,6 +312,21 @@ def get_providers() -> dict[str, Any]: key_source = "config_yaml" else: key_source = "config_yaml" + else: + # Fallback: provider may be authenticated via hermes auth even + # though it is not in the hardcoded _OAUTH_PROVIDERS set + # (e.g. Anthropic connected via OAuth). Check live auth + # status so the Providers tab agrees with the model picker + # (#1212). + try: + from hermes_cli.auth import get_auth_status as _gas + status = _gas(pid) + if isinstance(status, dict) and status.get("logged_in"): + has_key = True + key_source = status.get("key_source", "oauth") + is_oauth = True + except Exception: + pass models = _PROVIDER_MODELS.get(pid, []) # Also include models from config.yaml providers section diff --git a/static/panels.js b/static/panels.js index c9bba4b3..408a1915 100644 --- a/static/panels.js +++ b/static/panels.js @@ -2099,6 +2099,9 @@ async function switchToProfile(name) { // No messages yet — just refresh the list and topbar in place await renderSessionList(); syncTopbar(); + // Refresh workspace file tree so the right panel shows the new + // profile's workspace, not the previous one (#1214). + if (S.session && S.session.workspace) loadDir('.'); showToast(t('profile_switched', name)); }