The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(cli): /config names a Vertex route's credential as Google OAuth
Tekniumbf59361d207b
diff --git a/cli.py b/cli.pyindex 6852a35046e..37581631e2f 100644--- a/cli.py+++ b/cli.py@@ -1057,7 +1057,11 @@ class HermesCLI(CLIInitMixin, CLITuiRuntimeMixin, CLIProcessNotificationsMixin,display_key = self.api_keyif self.agent is not None and getattr(self.agent, "api_key", None):display_key = self.agent.api_key- if is_token_provider(display_key):+ if is_token_provider(display_key) and getattr(display_key, "__module__", "") == "agent.vertex_adapter":+ # Vertex's callable mints a Google OAuth token on first use (the gateway mints its own+ # for the turn); never mint one just to mask it here.+ api_key_display = _t("cli.config.google_vertex_oauth")+ elif is_token_provider(display_key):api_key_display = _t("cli.config.microsoft_entra_id")elif isinstance(display_key, str) and len(display_key) > 12:api_key_display = f"{display_key[:8]}...{display_key[-4:]}"diff --git a/locales/af.yaml b/locales/af.yamlindex 7438262a69b..809d0c9d1b6 100644--- a/locales/af.yaml+++ b/locales/af.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(gelaai)"not_found: "(nie gevind nie)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Nie gestel nie!"value_not_set: "nie gestel nie"section_model: "Model"diff --git a/locales/ar.yaml b/locales/ar.yamlindex e16a308c0b0..76476cf4d0f 100644--- a/locales/ar.yaml+++ b/locales/ar.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(محمّل)"not_found: "(غير موجود)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "غير معيّن!"value_not_set: "غير معيّن"section_model: "النموذج"diff --git a/locales/de.yaml b/locales/de.yamlindex 8a39d5fb74f..6d92356e98f 100644--- a/locales/de.yaml+++ b/locales/de.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(geladen)"not_found: "(nicht gefunden)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Nicht gesetzt!"value_not_set: "nicht gesetzt"section_model: "Modell"diff --git a/locales/en.yaml b/locales/en.yamlindex cccaf90da1d..066d35d9a83 100644--- a/locales/en.yaml+++ b/locales/en.yaml@@ -3212,6 +3212,7 @@ cli:loaded: "(loaded)"not_found: "(not found)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Not set!"value_not_set: "not set"section_model: "Model"diff --git a/locales/es.yaml b/locales/es.yamlindex 111e9577220..e686f2c1ef9 100644--- a/locales/es.yaml+++ b/locales/es.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(cargado)"not_found: "(no encontrado)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "¡Sin definir!"value_not_set: "sin definir"section_model: "Modelo"diff --git a/locales/fr.yaml b/locales/fr.yamlindex cc5512171e1..8513846efe2 100644--- a/locales/fr.yaml+++ b/locales/fr.yaml@@ -3419,6 +3419,7 @@ cli:loaded: "(chargé)"not_found: "(introuvable)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Non définie !"value_not_set: "non défini"section_model: "Modèle"diff --git a/locales/ga.yaml b/locales/ga.yamlindex 3da8ffe1a0a..8967ab6669a 100644--- a/locales/ga.yaml+++ b/locales/ga.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(lódáilte)"not_found: "(gan aimsiú)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Gan socrú!"value_not_set: "gan socrú"section_model: "Samhail"diff --git a/locales/hu.yaml b/locales/hu.yamlindex 52b233f3906..4543fcf0573 100644--- a/locales/hu.yaml+++ b/locales/hu.yaml@@ -3129,6 +3129,7 @@ cli:loaded: "(betöltve)"not_found: "(nem található)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Nincs beállítva!"value_not_set: "nincs beállítva"section_model: "Modell"diff --git a/locales/it.yaml b/locales/it.yamlindex 504edea4b85..1d452e2f4f1 100644--- a/locales/it.yaml+++ b/locales/it.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(caricato)"not_found: "(non trovato)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Non impostata!"value_not_set: "non impostato"section_model: "Modello"diff --git a/locales/ja.yaml b/locales/ja.yamlindex 0eccdc8dd48..f532c41654d 100644--- a/locales/ja.yaml+++ b/locales/ja.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(読み込み済み)"not_found: "(見つかりません)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "未設定!"value_not_set: "未設定"section_model: "モデル"diff --git a/locales/ko.yaml b/locales/ko.yamlindex 74cbac00d91..7d224a7fe03 100644--- a/locales/ko.yaml+++ b/locales/ko.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(불러옴)"not_found: "(찾을 수 없음)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "설정되지 않음!"value_not_set: "설정되지 않음"section_model: "모델"diff --git a/locales/pt.yaml b/locales/pt.yamlindex f4e4a7b17c3..6478c8ed017 100644--- a/locales/pt.yaml+++ b/locales/pt.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(carregado)"not_found: "(não encontrado)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Não definida!"value_not_set: "não definido"section_model: "Modelo"diff --git a/locales/ru.yaml b/locales/ru.yamlindex 1f8b092b0a1..e62a458996f 100644--- a/locales/ru.yaml+++ b/locales/ru.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(загружено)"not_found: "(не найдено)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Не задан!"value_not_set: "не задано"section_model: "Модель"diff --git a/locales/tr.yaml b/locales/tr.yamlindex 8b5ab233f80..b7b1becfba1 100644--- a/locales/tr.yaml+++ b/locales/tr.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(yüklendi)"not_found: "(bulunamadı)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Ayarlanmamış!"value_not_set: "ayarlanmamış"section_model: "Model"diff --git a/locales/uk.yaml b/locales/uk.yamlindex 8c9826c7b20..4802789cbc4 100644--- a/locales/uk.yaml+++ b/locales/uk.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(завантажено)"not_found: "(не знайдено)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "Не задано!"value_not_set: "не задано"section_model: "Модель"diff --git a/locales/zh-hant.yaml b/locales/zh-hant.yamlindex f07de039594..e944af93539 100644--- a/locales/zh-hant.yaml+++ b/locales/zh-hant.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(已載入)"not_found: "(找不到)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "未設定!"value_not_set: "未設定"section_model: "模型"diff --git a/locales/zh.yaml b/locales/zh.yamlindex 67984c7c4ed..bc7faca7b2b 100644--- a/locales/zh.yaml+++ b/locales/zh.yaml@@ -3112,6 +3112,7 @@ cli:loaded: "(已加载)"not_found: "(未找到)"microsoft_entra_id: "Microsoft Entra ID"+ google_vertex_oauth: "Google OAuth (Vertex AI)"api_key_not_set: "未设置!"value_not_set: "未设置"section_model: "模型"diff --git a/tests/hermes_cli/test_cli_config_vertex_label.py b/tests/hermes_cli/test_cli_config_vertex_label.pynew file mode 100644index 00000000000..c94e2bfc126--- /dev/null+++ b/tests/hermes_cli/test_cli_config_vertex_label.py@@ -0,0 +1,47 @@+"""T6 (#134889): classic-CLI ``/config`` on a Vertex route names the credential honestly.++The gateway-backed CLI resolves Vertex under ``deferred_token_mint``: its ``api_key`` is+``agent.vertex_adapter.vertex_access_token``, a callable that mints a Google OAuth token on first+use (the gateway mints its own for the turn). ``/config`` saw "a callable" and printed the Azure+label "Microsoft Entra ID". It must say Google OAuth and must never call the callable: masking a+token would mean a second JWT exchange from the CLI process, the double mint #106742 removed.+"""++from __future__ import annotations++from datetime import datetime++from agent.i18n import t+from cli import HermesCLI+++def _config_text(capsys, api_key) -> str:+ cli = HermesCLI.__new__(HermesCLI)+ cli.api_key, cli.agent = api_key, None+ cli.model = "google/gemini-3-flash-preview"+ cli.base_url = "https://us-central1-aiplatform.googleapis.com/v1beta1/projects/p/locations/us-central1/endpoints/openapi"+ cli.max_turns, cli.enabled_toolsets, cli.verbose = 10, [], False+ cli.session_start = datetime(2031, 1, 1)+ cli.show_config()+ return capsys.readouterr().out+++def test_config_labels_vertex_callable_as_google_oauth_without_minting(capsys, monkeypatch):+ import agent.vertex_adapter as va++ mints: list[int] = []+ monkeypatch.setattr(va, "get_vertex_credentials", lambda *_a, **_k: mints.append(1) or ("ya29.x", "p"))+ out = _config_text(capsys, va.vertex_access_token)++ api_line = next(line for line in out.splitlines() if t("cli.config.label_api_key") in line)+ assert t("cli.config.google_vertex_oauth") in api_line, out+ assert t("cli.config.microsoft_entra_id") not in out, out+ assert mints == [], "/config minted a Vertex token just to display it"+++def test_config_keeps_entra_label_for_other_token_providers(capsys):+ def entra_bearer_provider() -> str:+ raise AssertionError("never invoked")++ out = _config_text(capsys, entra_bearer_provider)+ assert t("cli.config.microsoft_entra_id") in out, out