From e3f1105db4e073d8164e68fb4c507eaedfb5b76b Mon Sep 17 00:00:00 2001 From: lidge-jun Date: Thu, 15 Oct 2026 06:20:55 -0700 Subject: [PATCH] Revert "fix(gui): select Advisor model from the routed catalog (#7114)" This reverts commit 60bf4c7e0c484ead61b2e556be6f1c0bafb0eb37. --- .../fr/reference/configuration/advisor.md | 2 - .../ja/reference/configuration/advisor.md | 2 - .../ko/reference/configuration/advisor.md | 2 - .../docs/reference/configuration/advisor.md | 2 - .../ru/reference/configuration/advisor.md | 2 - .../tr/reference/configuration/advisor.md | 2 - .../zh-cn/reference/configuration/advisor.md | 2 - .../zh-tw/reference/configuration/advisor.md | 2 - gui/src/advisor-models.ts | 11 -- gui/src/components/AdvisorModelSelect.tsx | 59 -------- gui/src/i18n/de.ts | 6 +- gui/src/i18n/en.ts | 6 +- gui/src/i18n/fr.ts | 6 +- gui/src/i18n/ja.ts | 6 +- gui/src/i18n/ko.ts | 6 +- gui/src/i18n/pt.ts | 6 +- gui/src/i18n/ru.ts | 6 +- gui/src/i18n/tr.ts | 6 +- gui/src/i18n/vi.ts | 6 +- gui/src/i18n/zh-TW.ts | 6 +- gui/src/i18n/zh.ts | 6 +- gui/src/pages/Advisor.tsx | 9 +- gui/tests/advisor-save-feedback.test.tsx | 129 +----------------- structure/advisor.md | 4 - structure/gui-and-management-api.md | 2 +- 25 files changed, 24 insertions(+), 272 deletions(-) delete mode 100644 gui/src/advisor-models.ts delete mode 100644 gui/src/components/AdvisorModelSelect.tsx diff --git a/docs-site/src/content/docs/fr/reference/configuration/advisor.md b/docs-site/src/content/docs/fr/reference/configuration/advisor.md index 09776260947..baf92fbb1db 100644 --- a/docs-site/src/content/docs/fr/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/fr/reference/configuration/advisor.md @@ -16,8 +16,6 @@ sidecar côté proxy invisible du client — même un worker qui ne spawn jamais ## Configuration -Sur la page **Advisor**, choisissez le modèle dans le catalogue. Le sélecteur conserve exactement les identifiants natifs, de fournisseur, de compte, personnalisés et de combo. Les modèles désactivés ou en attente de sélection initiale ne sont pas proposés. Un identifiant enregistré absent du catalogue reste visible avec un avertissement, jusqu’à son remplacement ou sa suppression. Un échec de chargement conserve la sélection et propose de réessayer. Choisissez un modèle capable de fournir des conseils textuels : le catalogue ne garantit pas la compatibilité des consultations. La CLI et l’API acceptent toujours les chaînes de modèle prises en charge par le routeur. - ```json { "advisor": { diff --git a/docs-site/src/content/docs/ja/reference/configuration/advisor.md b/docs-site/src/content/docs/ja/reference/configuration/advisor.md index b87ab3fab1c..c80ac5da93b 100644 --- a/docs-site/src/content/docs/ja/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/ja/reference/configuration/advisor.md @@ -9,8 +9,6 @@ description: OpenCodex 自身のエキスパート相談サイドカー — 設 ## 設定 -ダッシュボードの **Advisor** ページでカタログからモデルを選択します。ネイティブ、プロバイダー、アカウント指定、カスタム、コンボの識別子をそのまま保存します。無効なモデルと初期選択待ちのモデルは新規選択に表示されません。選択可能な一覧にない保存済み識別子は警告付きで保持され、別のモデルを選ぶか解除するまで変更されません。読み込みに失敗しても選択は保持され、再試行できます。テキストの助言を返せるモデルを選んでください。カタログは相談の互換性を保証しません。CLI と API は引き続きルーター対応のモデル文字列を受け付けます。 - ```json { "advisor": { diff --git a/docs-site/src/content/docs/ko/reference/configuration/advisor.md b/docs-site/src/content/docs/ko/reference/configuration/advisor.md index 40ae07864e1..d0539ae96e1 100644 --- a/docs-site/src/content/docs/ko/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/ko/reference/configuration/advisor.md @@ -9,8 +9,6 @@ description: OpenCodex가 소유한 전문가 상담 사이드카 — 구성된 ## 구성 -대시보드 **어드바이저** 페이지에서 카탈로그 선택기로 전문가 모델을 선택하세요. 네이티브, 공급자, 계정 지정, 사용자 정의 및 콤보 선택자의 정확한 카탈로그 식별자를 저장합니다. 비활성 모델과 초기 선택 대기 모델은 새 선택에 표시하지 않습니다. 선택 가능한 목록에 없는 저장된 식별자는 경고와 함께 유지되며, 다른 모델을 선택하거나 지우기 전까지 변경되지 않습니다. 카탈로그 로드 실패 시 현재 선택을 보존하고 재시도를 제공합니다. 텍스트 조언을 반환할 수 있는 모델을 선택하세요. 카탈로그가 상담 호환성을 보장하지는 않습니다. CLI와 API는 라우터가 지원하는 모델 문자열을 계속 허용합니다. - ```json { "advisor": { diff --git a/docs-site/src/content/docs/reference/configuration/advisor.md b/docs-site/src/content/docs/reference/configuration/advisor.md index d91410b6fe1..139256cb206 100644 --- a/docs-site/src/content/docs/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/reference/configuration/advisor.md @@ -16,8 +16,6 @@ never sees — even a worker that never spawns anything can be advised. ## Configuration -On the dashboard **Advisor** page, choose the expert model from the catalog selector. It saves the exact catalog identifier, including native, provider, account-qualified, custom and combo selectors. Disabled models and models awaiting initial selection are not offered as new choices. A saved identifier missing from the selectable catalog remains visible with a warning and is preserved until you choose another model or clear it. Catalog loading failures preserve the selection and provide Retry. Choose a model that can return text advice: the catalog does not guarantee consultation compatibility. The CLI and API continue to accept router-supported model strings. - ```json { "advisor": { diff --git a/docs-site/src/content/docs/ru/reference/configuration/advisor.md b/docs-site/src/content/docs/ru/reference/configuration/advisor.md index 8cb07090d95..2cd0e396e13 100644 --- a/docs-site/src/content/docs/ru/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/ru/reference/configuration/advisor.md @@ -9,8 +9,6 @@ description: Принадлежащий OpenCodex sidecar экспертных ## Конфигурация -На странице **Advisor** выберите модель из каталога. Селектор сохраняет точные идентификаторы нативных моделей, провайдеров, аккаунтов, пользовательских моделей и combo. Отключённые модели и модели, ожидающие начального выбора, не предлагаются. Сохранённый идентификатор вне доступного списка остаётся видимым с предупреждением до замены или очистки. Ошибка загрузки сохраняет выбор и позволяет повторить попытку. Выберите модель для текстовых советов: каталог не гарантирует совместимость консультаций. CLI и API по-прежнему принимают строки моделей, поддерживаемые маршрутизатором. - ```json { "advisor": { diff --git a/docs-site/src/content/docs/tr/reference/configuration/advisor.md b/docs-site/src/content/docs/tr/reference/configuration/advisor.md index f1a1e646f9a..a2b7de6a13a 100644 --- a/docs-site/src/content/docs/tr/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/tr/reference/configuration/advisor.md @@ -9,8 +9,6 @@ Bu, alt ajan yüzeyinden farklıdır (bkz. [Ajan yapılandırması](/tr/referenc ## Yapılandırma -Kontrol panelindeki **Advisor** sayfasında katalogdan model seçin. Yerel, sağlayıcı, hesap, özel model ve combo tanımlayıcıları aynen kaydedilir. Devre dışı veya ilk seçimi bekleyen modeller yeni seçenek olarak sunulmaz. Listede bulunmayan kayıtlı tanımlayıcı, değiştirilene veya temizlenene kadar uyarıyla korunur. Yükleme hatası seçimi korur ve yeniden deneme sunar. Metin önerisi verebilen bir model seçin; katalog danışma uyumluluğunu garanti etmez. CLI ve API, yönlendiricinin desteklediği model dizelerini kabul etmeye devam eder. - ```json { "advisor": { diff --git a/docs-site/src/content/docs/zh-cn/reference/configuration/advisor.md b/docs-site/src/content/docs/zh-cn/reference/configuration/advisor.md index 79d590c1835..3ef528c6135 100644 --- a/docs-site/src/content/docs/zh-cn/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/zh-cn/reference/configuration/advisor.md @@ -9,8 +9,6 @@ description: OpenCodex 自有的专家咨询 sidecar — 配置的专家模型 ## 配置 -在仪表板 **Advisor** 页面从目录选择专家模型。选择器原样保存原生、提供商、指定账户、自定义和组合模型的标识符。已禁用和等待初始选择的模型不会作为新选项。已保存但不在可选目录中的标识符会保留并显示警告,直到您选择其他模型或清除。目录加载失败时保留当前选择并提供重试。请选择能返回文本建议的模型;目录不保证咨询兼容性。CLI 和 API 仍接受路由器支持的模型字符串。 - ```json { "advisor": { diff --git a/docs-site/src/content/docs/zh-tw/reference/configuration/advisor.md b/docs-site/src/content/docs/zh-tw/reference/configuration/advisor.md index b599f8205c0..655328acc95 100644 --- a/docs-site/src/content/docs/zh-tw/reference/configuration/advisor.md +++ b/docs-site/src/content/docs/zh-tw/reference/configuration/advisor.md @@ -9,8 +9,6 @@ description: OpenCodex 自有的專家諮詢 sidecar — 設定的專家模型 ## 設定 -在儀表板 **Advisor** 頁面從目錄選擇專家模型。選擇器原樣儲存原生、供應商、指定帳戶、自訂和組合模型的識別碼。已停用和等待初始選擇的模型不會作為新選項。已儲存但不在可選目錄中的識別碼會保留並顯示警告,直到您選擇其他模型或清除。目錄載入失敗時保留目前選擇並提供重試。請選擇能回傳文字建議的模型;目錄不保證諮詢相容性。CLI 和 API 仍接受路由器支援的模型字串。 - ```json { "advisor": { diff --git a/gui/src/advisor-models.ts b/gui/src/advisor-models.ts deleted file mode 100644 index 7ff4ca2f2e8..00000000000 --- a/gui/src/advisor-models.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface AdvisorModelRow { - namespaced: string; - disabled?: boolean; - initialSelectionPending?: boolean; -} - -/** Keep routing selectors opaque: labels and model display names are not model IDs. */ -export function advisorModelValues(rows: readonly AdvisorModelRow[]): string[] { - return [...new Set(rows.filter(row => !row.disabled && !row.initialSelectionPending) - .map(row => row.namespaced))]; -} diff --git a/gui/src/components/AdvisorModelSelect.tsx b/gui/src/components/AdvisorModelSelect.tsx deleted file mode 100644 index 75d7a32f635..00000000000 --- a/gui/src/components/AdvisorModelSelect.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { useDataSurface } from "../data-surface"; -import { useT } from "../i18n/shared"; -import { Notice, Select } from "../ui"; -import { advisorModelValues, type AdvisorModelRow } from "../advisor-models"; - -export function AdvisorModelSelect({ apiBase, value, disabled, onChange }: { - apiBase: string; - value: string; - disabled: boolean; - onChange: (value: string) => void; -}) { - const t = useT(); - const resource = useDataSurface( - `advisor-models:${apiBase}`, - [apiBase], - async signal => { - const response = await fetch(`${apiBase}/api/models`, { signal }); - if (!response.ok) throw new Error(String(response.status)); - const rows: unknown = await response.json(); - if (!Array.isArray(rows) || !rows.every(row => row && typeof row.namespaced === "string" && row.namespaced.length > 0)) { - throw new Error("Invalid model catalog"); - } - return rows as AdvisorModelRow[]; - }, - { isEmpty: rows => rows.length === 0 }, - ); - const { state } = resource; - const values = advisorModelValues(state.data ?? []); - const unavailable = value !== "" && !values.includes(value); - const options = [ - { value: "", label: t("advisor.modelClear") }, - ...(unavailable ? [{ value, label: value }] : []), - ...values.map(model => ({ value: model, label: model })), - ]; - return ( -
-