diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c25a9848..5a9cb6a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to **omp-web** (`@kahme247/ompweb`) are documented in this f ### Added +- **Find the default model setting.** Settings → AI Model Defaults now links directly to OMP Model Roles. - **A distinct ompweb icon.** The rounded π inside an open orbit retains the pink–purple–cyan palette. The sidebar logo, SVG/PNG artwork, favicons, installed-app icons and tray icon now use the same mark. - **Upgrades check the session omp before they switch.** `ompweb preflight` resolves omp exactly as the host does for a new session (`OMP_WEB_OMP_BIN` or this version's downloaded `ompweb-omp`), starts it headless with `--no-session`, and waits up to 30 s for its hello: it prints `preflight ok: `, or exits 1 naming the binary and why (not found, not executable, exited with its code, or no hello with omp's last stderr). The host updater and the web app's in-app update run the new release's preflight in the live environment before they stop anything, and abort with the current install still running when it fails. Before the preflight, both run the new release's `ompweb fetch-omp`, so its runner is in place first. A release without the preflight command is checked only if it ships `ompweb-omp`; then the update fails. - **Rename the cluster.** Settings → Hosts shows the cluster's name with a **Rename cluster** button; the sidebar group follows. The cluster is still created as "Cluster" when the first host joins, so rename it afterwards. `PATCH /api/hosts { poolId, label }` renames a pool without replacing the pool registry. diff --git a/components/ModelsConfig.tsx b/components/ModelsConfig.tsx index 368da5feb..818c12f75 100644 --- a/components/ModelsConfig.tsx +++ b/components/ModelsConfig.tsx @@ -1037,7 +1037,7 @@ function OAuthDetail({ provider, onRefresh }: { provider: OAuthProvider; onRefre // ── Main component ──────────────────────────────────────────────────────────── -export function ModelsConfig({ onClose, onSelectTab, onSaved, embedded = false }: { onClose: () => void; onSelectTab?: (tab: SettingsTab) => void; onSaved?: () => void; embedded?: boolean }) { +export function ModelsConfig({ onClose, onSelectTab, onSaved, embedded = false, initialModelRoles = false }: { onClose: () => void; onSelectTab?: (tab: SettingsTab) => void; onSaved?: () => void; embedded?: boolean; initialModelRoles?: boolean }) { const { t, tn } = useI18n(); const isMobile = useIsMobile(); const [config, setConfig] = useState({ providers: {} }); @@ -1045,9 +1045,9 @@ export function ModelsConfig({ onClose, onSelectTab, onSaved, embedded = false } const [saving, setSaving] = useState(false); const [saveError, setSaveError] = useState(null); const [savedOk, setSavedOk] = useState(false); - const [subTab, setSubTab] = useState<"connected" | "custom" | "system">("connected"); - const [systemTab, setSystemTab] = useState<"registry" | "picker" | "roles" | "fallbacks">("registry"); - const [selection, setSelection] = useState(null); + const [subTab, setSubTab] = useState<"connected" | "custom" | "system">(initialModelRoles ? "system" : "connected"); + const [systemTab, setSystemTab] = useState<"registry" | "picker" | "roles" | "fallbacks">(initialModelRoles ? "roles" : "registry"); + const [selection, setSelection] = useState(initialModelRoles ? { type: "roles" } : null); const [oauthProviders, setOauthProviders] = useState([]); const [apiKeyProviders, setApiKeyProviders] = useState([]); const [runtimeModels, setRuntimeModels] = useState([]); diff --git a/components/SettingsConfig.browser-transport.test.mjs b/components/SettingsConfig.browser-transport.test.mjs index 5dbd9a442..16798a846 100644 --- a/components/SettingsConfig.browser-transport.test.mjs +++ b/components/SettingsConfig.browser-transport.test.mjs @@ -98,3 +98,15 @@ test("the browser transport control shows the WebSocket link when the server sen unmount(); } }); + +test("default model settings open the OMP model roles directly", async (t) => { + const originalFetch = globalThis.fetch; + globalThis.fetch = async () => Response.json({}); + t.after(() => { cleanup(); globalThis.fetch = originalFetch; }); + let view; + const props = { ...settingsProps, activeTab: "models", onSelectTab: (activeTab) => view.rerender(createElement(SettingsConfig, { ...props, activeTab })) }; + view = render(createElement(SettingsConfig, props)); + await settle(); + fireEvent.click(within(view.container).getByRole("button", { name: "Open OMP settings" })); + assert.ok(await within(view.container).findByRole("combobox", { name: "Model override for default" })); +}); diff --git a/components/SettingsConfig.tsx b/components/SettingsConfig.tsx index 6e76a3a0c..93aa1ca02 100644 --- a/components/SettingsConfig.tsx +++ b/components/SettingsConfig.tsx @@ -180,6 +180,7 @@ const SETTING_INDEX: SettingIndexEntry[] = [ { id: "bash-override", tab: "safety", sectionKey: "settingsConfig.toolSafetyApprovals", labelKey: "settingsConfig.bashOverride", descKey: "settingsConfig.bashOverrideDesc", fallbackSection: "Tool Safety & Approvals", fallbackLabel: "Bash Override", fallbackDesc: "Override default approval policy specifically for terminal commands.", scope: "Native OMP" }, { id: "extension-tool-requests", tab: "safety", sectionKey: "settingsConfig.toolSafetyApprovals", labelKey: "settingsConfig.extensionToolRequests", descKey: "settingsConfig.extensionToolRequestsDesc", fallbackSection: "Tool Safety & Approvals", fallbackLabel: "Extension Tool Requests", fallbackDesc: "Automatically approve extension tool authorization requests.", scope: "Native OMP" }, // AI Model Defaults + { id: "default-model", tab: "models", sectionKey: "settingsConfig.modelDefaults", labelKey: "settingsConfig.defaultModel", descKey: "settingsConfig.defaultModelDesc", fallbackSection: "AI Model Defaults", fallbackLabel: "Default AI Model", fallbackDesc: "Choose the default model in OMP model roles.", scope: "Native OMP" }, { id: "reasoning", tab: "models", sectionKey: "settingsConfig.modelDefaults", labelKey: "settingsConfig.reasoning", descKey: "settingsConfig.reasoningDesc", fallbackSection: "AI Model Defaults", fallbackLabel: "Reasoning", fallbackDesc: "Default effort level for thinking-capable models.", scope: "Native OMP" }, { id: "auto-thinking-source", tab: "models", sectionKey: "settingsConfig.modelDefaults", labelKey: "settingsConfig.autoThinkingSource", descKey: "settingsConfig.autoThinkingSourceDesc", fallbackSection: "AI Model Defaults", fallbackLabel: "Auto Thinking Source", fallbackDesc: "Choose prompt classification or the publisher default with omp fallback.", scope: "Native OMP" }, { id: "verbosity", tab: "models", sectionKey: "settingsConfig.modelDefaults", labelKey: "settingsConfig.verbosity", descKey: "settingsConfig.verbosityDesc", fallbackSection: "AI Model Defaults", fallbackLabel: "Verbosity", fallbackDesc: "Response detail level for supporting providers.", scope: "Native OMP" }, @@ -927,6 +928,7 @@ export function SettingsConfig({ activeTab, toolCallsDefaultCollapsed, onToolCal } = useSpeechSynthesis(); const [searchQuery, setSearchQuery] = useState(""); const [highlightId, setHighlightId] = useState(null); + const openModelRolesRef = useRef(false); const [submitBehavior, setSubmitBehavior] = useState(() => getSubmitDuringRunBehavior()); const [wordCompletion, setWordCompletion] = useState(() => getWordCompletionMode()); const connectionDiagnostics = useConnectionDiagnosticsEnabled(); @@ -1134,12 +1136,14 @@ export function SettingsConfig({ activeTab, toolCallsDefaultCollapsed, onToolCal }, [trimmedQuery, t, nativeSettings?.defaultThinkingLevel]); const openSearchResult = useCallback((result: SearchResult) => { + openModelRolesRef.current = false; startTransition(() => onSelectTab(result.tab)); setHighlightId(result.kind === "setting" ? result.id : null); setSearchQuery(""); }, [onSelectTab]); const handleSelectTab = useCallback((tab: SettingsTab) => { + openModelRolesRef.current = false; startTransition(() => onSelectTab(tab)); }, [onSelectTab]); @@ -1514,6 +1518,9 @@ export function SettingsConfig({ activeTab, toolCallsDefaultCollapsed, onToolCal

{t("settingsConfig.modelDefaultsDesc")}

+ + +