Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <omp> <version>`, 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.
Expand Down
8 changes: 4 additions & 4 deletions components/ModelsConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1037,17 +1037,17 @@ 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<ModelsFileData>({ providers: {} });
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [saveError, setSaveError] = useState<string | null>(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<Selection | null>(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<Selection | null>(initialModelRoles ? { type: "roles" } : null);
const [oauthProviders, setOauthProviders] = useState<OAuthProvider[]>([]);
const [apiKeyProviders, setApiKeyProviders] = useState<ApiKeyProvider[]>([]);
const [runtimeModels, setRuntimeModels] = useState<RuntimeModelEntry[]>([]);
Expand Down
12 changes: 12 additions & 0 deletions components/SettingsConfig.browser-transport.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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" }));
});
9 changes: 8 additions & 1 deletion components/SettingsConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down Expand Up @@ -927,6 +928,7 @@ export function SettingsConfig({ activeTab, toolCallsDefaultCollapsed, onToolCal
} = useSpeechSynthesis();
const [searchQuery, setSearchQuery] = useState("");
const [highlightId, setHighlightId] = useState<string | null>(null);
const openModelRolesRef = useRef(false);
const [submitBehavior, setSubmitBehavior] = useState<SubmitDuringRunBehavior>(() => getSubmitDuringRunBehavior());
const [wordCompletion, setWordCompletion] = useState<WordCompletionMode>(() => getWordCompletionMode());
const connectionDiagnostics = useConnectionDiagnosticsEnabled();
Expand Down Expand Up @@ -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]);

Expand Down Expand Up @@ -1514,6 +1518,9 @@ export function SettingsConfig({ activeTab, toolCallsDefaultCollapsed, onToolCal
<p className="settings-content-subtitle" style={{ margin: "4px 0 16px", fontSize: "var(--text-md)", color: "var(--text-muted)", lineHeight: 1.45 }}>{t("settingsConfig.modelDefaultsDesc")}</p>
</div>
<div style={{ display: "flex", flexDirection: "column", gap: 10, width: "100%" }}>
<NativeSetting searchId="default-model" label={t("settingsConfig.defaultModel")} description={t("settingsConfig.defaultModelDesc")} scope="Native OMP">
<button type="button" id="open-omp-model-roles" aria-labelledby="open-omp-model-roles" aria-label={t("settingsConfig.openOmpSettings")} className="settings-back ui-focus-ring" onClick={() => { openModelRolesRef.current = true; onSelectTab("providers"); }}>{t("settingsConfig.openOmpSettings")}</button>
</NativeSetting>
<NativeSetting searchId="reasoning" label={t("settingsConfig.reasoning")} description={t("settingsConfig.reasoningDesc")} scope="Native OMP">
<select
style={nativeSelectStyle}
Expand Down Expand Up @@ -1585,7 +1592,7 @@ export function SettingsConfig({ activeTab, toolCallsDefaultCollapsed, onToolCal
<h2 className="display-serif" style={{ fontSize: 22, fontWeight: 600, margin: 0, color: "var(--text)", letterSpacing: "-0.01em" }}>{t("settingsTabs.providers.label")}</h2>
<p className="settings-content-subtitle" style={{ margin: "4px 0 16px", fontSize: 13, color: "var(--text-muted)", lineHeight: 1.45 }}>{t("settingsTabs.providers.description")}</p>
</div>
<ModelsConfig embedded onClose={onClose} onSaved={onModelsSaved} />
<ModelsConfig embedded onClose={onClose} onSaved={onModelsSaved} initialModelRoles={openModelRolesRef.current} />
</div>
)}

Expand Down
3 changes: 3 additions & 0 deletions lib/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,9 @@
"settingsConfig.autoApprove": "Auto approve",
"settingsConfig.modelDefaults": "AI Model Defaults",
"settingsConfig.modelDefaultsDesc": "Configure default reasoning effort, response verbosity, personality tone, and thinking display.",
"settingsConfig.defaultModel": "Default AI Model",
"settingsConfig.defaultModelDesc": "Choose the default model in OMP model roles.",
"settingsConfig.openOmpSettings": "Open OMP settings",
"settingsConfig.reasoning": "Reasoning",
"settingsConfig.reasoningDesc": "Default effort level for thinking-capable models.",
"settingsConfig.autoThinkingSource": "Auto Thinking Source",
Expand Down
3 changes: 3 additions & 0 deletions lib/i18n/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,9 @@
"settingsConfig.autoApprove": "自動核准",
"settingsConfig.modelDefaults": "AI 模型預設值",
"settingsConfig.modelDefaultsDesc": "設定預設推論力度、回應詳盡程度、性格語氣與思考顯示。",
"settingsConfig.defaultModel": "預設 AI 模型",
"settingsConfig.defaultModelDesc": "在 OMP 模型角色中選擇預設模型。",
"settingsConfig.openOmpSettings": "開啟 OMP 設定",
"settingsConfig.reasoning": "推論",
"settingsConfig.reasoningDesc": "支援思考之模型的預設推論力度。",
"settingsConfig.autoThinkingSource": "自動思考來源",
Expand Down
Loading