Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

feat(release): implement Hermes CLI config and message content stripping (#1475, #1387)

diegosouzapw7549a68d6cd8
diff --git a/open-sse/config/providerModels.ts b/open-sse/config/providerModels.ts
index a1c37e4d87..6b210ec20e 100644
--- a/open-sse/config/providerModels.ts
+++ b/open-sse/config/providerModels.ts
@@ -47,6 +47,13 @@ export function getModelTargetFormat(aliasOrId: string, modelId: string): string
return found?.targetFormat || null;
}
+export function getModelStripTypes(aliasOrId: string, modelId: string): string[] {
+ const models = PROVIDER_MODELS[aliasOrId];
+ if (!models) return [];
+ const found = models.find((m) => m.id === modelId);
+ return Array.isArray(found?.strip) ? [...found.strip] : [];
+}
+
export function getModelsByProviderId(providerId: string): RegistryModel[] {
const alias = PROVIDER_ID_TO_ALIAS[providerId] || providerId;
return PROVIDER_MODELS[alias] || [];
diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts
index 38f5c4323d..f6e4e92ea1 100644
--- a/open-sse/config/providerRegistry.ts
+++ b/open-sse/config/providerRegistry.ts
@@ -46,6 +46,8 @@ export interface RegistryModel {
supportsXHighEffort?: boolean;
targetFormat?: string;
unsupportedParams?: readonly string[];
+ /** Content types to remove before translation/upstream dispatch. */
+ strip?: readonly string[];
/** Maximum context window in tokens */
contextLength?: number;
}
@@ -596,6 +598,19 @@ export const REGISTRY: Record<string, RegistryEntry> = {
],
},
+ "azure-openai": {
+ id: "azure-openai",
+ alias: "azure",
+ format: "openai",
+ executor: "azure-openai",
+ baseUrl: "https://example-resource.openai.azure.com",
+ authType: "apikey",
+ authHeader: "api-key",
+ defaultContextLength: 128000,
+ models: [],
+ passthroughModels: true,
+ },
+
anthropic: {
id: "anthropic",
alias: "anthropic",
@@ -628,6 +643,7 @@ export const REGISTRY: Record<string, RegistryEntry> = {
format: "openai",
executor: "opencode",
baseUrl: "https://opencode.ai/zen/go/v1",
+ modelsUrl: "https://opencode.ai/zen/go/v1/models",
// (#532) Key validation must hit the main zen endpoint (same key works for both tiers)
testKeyBaseUrl: "https://opencode.ai/zen/v1",
authType: "apikey",
@@ -710,6 +726,25 @@ export const REGISTRY: Record<string, RegistryEntry> = {
models: [...GLM_SHARED_MODELS],
},
+ "glm-cn": {
+ id: "glm-cn",
+ alias: "glmcn",
+ format: "openai",
+ executor: "default",
+ baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",
+ modelsUrl: "https://open.bigmodel.cn/api/coding/paas/v4/models",
+ authType: "apikey",
+ authHeader: "bearer",
+ defaultContextLength: 200000,
+ models: [
+ { id: "glm-5.1", name: "GLM 5.1" },
+ { id: "glm-5", name: "GLM 5" },
+ { id: "glm-4.7", name: "GLM 4.7" },
+ { id: "glm-4.6", name: "GLM 4.6" },
+ { id: "glm-4.5-air", name: "GLM 4.5 Air" },
+ ],
+ },
+
"bailian-coding-plan": {
id: "bailian-coding-plan",
alias: "bcp",
@@ -727,7 +762,7 @@ export const REGISTRY: Record<string, RegistryEntry> = {
models: [
{ id: "qwen3.5-plus", name: "Qwen3.5 Plus" },
{ id: "qwen3-max-2026-01-23", name: "Qwen3 Max (2026-01-23)" },
- { id: "qwen3-coder-next", name: "Qwen3 Coder Next" },
+ { id: "qwen3-coder-next", name: "Qwen3 Coder Next", strip: ["image", "audio"] },
{ id: "qwen3-coder-plus", name: "Qwen3 Coder Plus" },
{ id: "MiniMax-M2.5", name: "MiniMax M2.5" },
{ id: "glm-5", name: "GLM 5" },
@@ -965,8 +1000,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authType: "apikey",
authHeader: "bearer",
models: [
- { id: "deepseek-chat", name: "DeepSeek V3.2 Chat" },
- { id: "deepseek-reasoner", name: "DeepSeek V3.2 Reasoner" },
+ { id: "deepseek-chat", name: "DeepSeek V3.2 Chat", strip: ["image", "audio"] },
+ { id: "deepseek-reasoner", name: "DeepSeek V3.2 Reasoner", strip: ["image", "audio"] },
],
},
@@ -1253,8 +1288,16 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authType: "apikey",
authHeader: "bearer",
models: [
- { id: "deepseek-ai/DeepSeek-V3.2", name: "DeepSeek V3.2" },
- { id: "deepseek-ai/DeepSeek-V3.1", name: "DeepSeek V3.1" },
+ {
+ id: "deepseek-ai/DeepSeek-V3.2",
+ name: "DeepSeek V3.2",
+ strip: ["image", "audio"],
+ },
+ {
+ id: "deepseek-ai/DeepSeek-V3.1",
+ name: "DeepSeek V3.1",
+ strip: ["image", "audio"],
+ },
{ id: "deepseek-ai/DeepSeek-R1", name: "DeepSeek R1" },
{ id: "Qwen/Qwen3-235B-A22B-Instruct-2507", name: "Qwen3 235B" },
{ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", name: "Qwen3 Coder 480B" },
@@ -1381,6 +1424,21 @@ export const REGISTRY: Record<string, RegistryEntry> = {
],
},
+ "vertex-partner": {
+ id: "vertex-partner",
+ alias: "vp",
+ format: "gemini",
+ executor: "vertex",
+ baseUrl: "https://us-central1-aiplatform.googleapis.com/v1/projects",
+ authType: "apikey",
+ authHeader: "bearer",
+ models: [
+ { id: "deepseek-v3.2", name: "DeepSeek V3.2 (Vertex Partner)" },
+ { id: "qwen3-next-80b", name: "Qwen3 Next 80B (Vertex Partner)" },
+ { id: "glm-5", name: "GLM-5 (Vertex Partner)" },
+ ],
+ },
+
alibaba: {
id: "alibaba",
alias: "ali",
diff --git a/open-sse/executors/azure-openai.ts b/open-sse/executors/azure-openai.ts
new file mode 100644
index 0000000000..55cef12ffa
--- /dev/null
+++ b/open-sse/executors/azure-openai.ts
@@ -0,0 +1,41 @@
+import { DefaultExecutor } from "./default.ts";
+
+const DEFAULT_API_VERSION = "2024-12-01-preview";
+
+function normalizeAzureBaseUrl(rawBaseUrl?: string | null): string {
+ const normalized = (rawBaseUrl || "").trim().replace(/\/+$/, "");
+ if (!normalized) return "";
+
+ return normalized
+ .replace(/\/openai$/i, "")
+ .replace(/\/openai\/deployments\/[^/]+\/chat\/completions.*$/i, "");
+}
+
+export class AzureOpenAIExecutor extends DefaultExecutor {
+ constructor() {
+ super("azure-openai");
+ }
+
+ buildUrl(model: string, stream: boolean, urlIndex = 0, credentials: any = null) {
+ void urlIndex;
+
+ const providerSpecificData = credentials?.providerSpecificData || {};
+ const baseUrl = normalizeAzureBaseUrl(providerSpecificData.baseUrl || this.config.baseUrl);
+ const apiVersion =
+ typeof providerSpecificData.apiVersion === "string" && providerSpecificData.apiVersion.trim()
+ ? providerSpecificData.apiVersion.trim()
+ : DEFAULT_API_VERSION;
+ return `${baseUrl}/openai/deployments/${encodeURIComponent(model)}/chat/completions?api-version=${encodeURIComponent(apiVersion)}`;
+ }
+
+ buildHeaders(credentials: any, stream = true) {
+ const apiKey = credentials?.apiKey || credentials?.accessToken || "";
+ const headers: Record<string, string> = {
+ "Content-Type": "application/json",
+ "api-key": apiKey,
+ };
+
+ headers.Accept = stream ? "text/event-stream" : "application/json";
+ return headers;
+ }
+}
diff --git a/open-sse/executors/index.ts b/open-sse/executors/index.ts
index d6386eb066..8d5a15fbe2 100644
--- a/open-sse/executors/index.ts
+++ b/open-sse/executors/index.ts
@@ -14,6 +14,7 @@ import { VertexExecutor } from "./vertex.ts";
import { CliproxyapiExecutor } from "./cliproxyapi.ts";
import { PerplexityWebExecutor } from "./perplexity-web.ts";
import { GrokWebExecutor } from "./grok-web.ts";
+import { AzureOpenAIExecutor } from "./azure-openai.ts";
const executors = {
antigravity: new AntigravityExecutor(),
@@ -24,6 +25,7 @@ const executors = {
codex: new CodexExecutor(),
cursor: new CursorExecutor(),
cu: new CursorExecutor(), // Alias for cursor
+ "azure-openai": new AzureOpenAIExecutor(),
pollinations: new PollinationsExecutor(),
pol: new PollinationsExecutor(), // Alias
"cloudflare-ai": new CloudflareAIExecutor(),
@@ -33,6 +35,7 @@ const executors = {
puter: new PuterExecutor(),
pu: new PuterExecutor(), // Alias
vertex: new VertexExecutor(),
+ "vertex-partner": new VertexExecutor(),
cliproxyapi: new CliproxyapiExecutor(),
cpa: new CliproxyapiExecutor(), // Alias
"perplexity-web": new PerplexityWebExecutor(),
@@ -69,3 +72,4 @@ export { CliproxyapiExecutor } from "./cliproxyapi.ts";
export { VertexExecutor } from "./vertex.ts";
export { PerplexityWebExecutor } from "./perplexity-web.ts";
export { GrokWebExecutor } from "./grok-web.ts";
+export { AzureOpenAIExecutor } from "./azure-openai.ts";
diff --git a/open-sse/handlers/chatCore.ts b/open-sse/handlers/chatCore.ts
index 062a0ae8ce..d608a8febe 100644
--- a/open-sse/handlers/chatCore.ts
+++ b/open-sse/handlers/chatCore.ts
@@ -12,6 +12,10 @@ import { addBufferToUsage, filterUsageForFormat, estimateUsage } from "../utils/
import { refreshWithRetry } from "../services/tokenRefresh.ts";
import { createRequestLogger } from "../utils/requestLogger.ts";
import { getModelTargetFormat, PROVIDER_ID_TO_ALIAS } from "../config/providerModels.ts";
+import {
+ getStripTypesForProviderModel,
+ stripIncompatibleMessageContent,
+} from "../services/modelStrip.ts";
import { resolveModelAlias } from "../services/modelDeprecation.ts";
import { getUnsupportedParams } from "../config/providerRegistry.ts";
import {
@@ -1316,6 +1320,21 @@ export async function handleChatCore({
const isClaudeCodeCompatible = isClaudeCodeCompatibleProvider(provider);
const upstreamStream = stream || isClaudeCodeCompatible;
let ccSessionId: string | null = null;
+ const stripTypes = getStripTypesForProviderModel(provider || "", model || "");
+
+ if (Array.isArray(translatedBody?.messages) && stripTypes.length > 0) {
+ const stripResult = stripIncompatibleMessageContent(translatedBody.messages, stripTypes);
+ if (stripResult.removedParts > 0) {
+ translatedBody = {
+ ...translatedBody,
+ messages: stripResult.messages,
+ };
+ log?.warn?.(
+ "CONTENT",
+ `Stripped ${stripResult.removedParts} incompatible content part(s) for ${provider}/${model}`
+ );
+ }
+ }
// Determine if we should preserve client-side cache_control headers
// Fetch settings from DB to get user preference
diff --git a/open-sse/services/antigravityHeaders.ts b/open-sse/services/antigravityHeaders.ts
index 8c8d3d32ec..542b8f5e90 100644
--- a/open-sse/services/antigravityHeaders.ts
+++ b/open-sse/services/antigravityHeaders.ts
@@ -16,7 +16,7 @@ import {
type AntigravityHeaderProfile = "loadCodeAssist" | "fetchAvailableModels" | "models";
const ANTIGRAVITY_VERSION = ANTIGRAVITY_FALLBACK_VERSION;
-const GEMINI_CLI_VERSION = "1.0.0";
+const GEMINI_CLI_VERSION = "0.31.0";
const GEMINI_SDK_VERSION = "1.41.0";
const NODE_VERSION = "v22.19.0";
const LOAD_CODE_ASSIST_USER_AGENT = "google-api-nodejs-client/9.15.1";
@@ -42,8 +42,6 @@ function getPlatform(): string {
switch (p) {
case "win32":
return "windows";
- case "darwin":
- return "macos";
default:
return p; // "linux", etc.
}
diff --git a/open-sse/services/modelStrip.ts b/open-sse/services/modelStrip.ts
new file mode 100644
index 0000000000..d3f705d20e
--- /dev/null
+++ b/open-sse/services/modelStrip.ts
@@ -0,0 +1,60 @@
+import { PROVIDER_ID_TO_ALIAS, getModelStripTypes } from "../config/providerModels.ts";
+
+type JsonRecord = Record<string, unknown>;
+
+function asRecord(value: unknown): JsonRecord {
+ return value && typeof value === "object" && !Array.isArray(value) ? (value as JsonRecord) : {};
+}
+
+function shouldStripPart(part: JsonRecord, stripTypes: Set<string>): boolean {
+ const type = typeof part.type === "string" ? part.type : "";
+ if (!type) return false;
+
+ if (stripTypes.has(type)) return true;
+ if (stripTypes.has("image") && (type === "image_url" || type === "image")) return true;
+ if (stripTypes.has("audio") && (type === "input_audio" || type === "audio")) return true;
+ return false;
+}
+
+export function stripIncompatibleMessageContent(
+ messages: unknown,
+ stripTypes: readonly string[]
+): { messages: unknown; removedParts: number } {
+ if (!Array.isArray(messages) || stripTypes.length === 0) {
+ return { messages, removedParts: 0 };
+ }
+
+ const stripSet = new Set(stripTypes);
+ let removedParts = 0;
+
+ const sanitizedMessages = messages.map((message) => {
+ const record = asRecord(message);
+ if (!Array.isArray(record.content)) {
+ return message;
+ }
+
+ const filteredContent = record.content.filter((part) => {
+ const shouldStrip = shouldStripPart(asRecord(part), stripSet);
+ if (shouldStrip) {
+ removedParts += 1;
+ }
+ return !shouldStrip;
+ });
+
+ if (filteredContent.length > 0) {
+ return { ...record, content: filteredContent };
+ }
+
+ return {
+ ...record,
+ content: [{ type: "text", text: "[unsupported image/audio content removed]" }],
+ };
+ });
+
+ return { messages: sanitizedMessages, removedParts };
+}
+
+export function getStripTypesForProviderModel(providerId: string, modelId: string): string[] {
+ const alias = PROVIDER_ID_TO_ALIAS[providerId] || providerId;
+ return getModelStripTypes(alias, modelId);
+}
diff --git a/src/app/(dashboard)/dashboard/logs/page.tsx b/src/app/(dashboard)/dashboard/logs/page.tsx
index 9df2d0ada2..f547814b7a 100644
--- a/src/app/(dashboard)/dashboard/logs/page.tsx
+++ b/src/app/(dashboard)/dashboard/logs/page.tsx
@@ -3,6 +3,7 @@
import { useState, useRef, useEffect } from "react";
import { RequestLoggerV2, ProxyLogger, SegmentedControl } from "@/shared/components";
import ConsoleLogViewer from "@/shared/components/ConsoleLogViewer";
+import ActiveRequestsPanel from "@/shared/components/ActiveRequestsPanel";
import AuditLogTab from "./AuditLogTab";
import { useTranslations } from "next-intl";
@@ -132,7 +133,12 @@ export default function LogsPage() {
</div>
{/* Content */}
- {activeTab === "request-logs" && <RequestLoggerV2 />}
+ {activeTab === "request-logs" && (
+ <div className="flex flex-col gap-6">
+ <ActiveRequestsPanel />
+ <RequestLoggerV2 />
+ </div>
+ )}
{activeTab === "proxy-logs" && <ProxyLogger />}
{activeTab === "audit-logs" && <AuditLogTab />}
{activeTab === "console" && <ConsoleLogViewer />}
diff --git a/src/app/(dashboard)/dashboard/providers/[id]/page.tsx b/src/app/(dashboard)/dashboard/providers/[id]/page.tsx
index 9eec81ee67..c8c1cfea04 100644
--- a/src/app/(dashboard)/dashboard/providers/[id]/page.tsx
+++ b/src/app/(dashboard)/dashboard/providers/[id]/page.tsx
@@ -5271,6 +5271,7 @@ ConnectionRow.propTypes = {
};
const CONFIGURABLE_BASE_URL_PROVIDERS = new Set([
+ "azure-openai",
"bailian-coding-plan",
"xiaomi-mimo",
"heroku",
@@ -5280,6 +5281,7 @@ const CONFIGURABLE_BASE_URL_PROVIDERS = new Set([
]);
const DEFAULT_PROVIDER_BASE_URLS: Record<string, string> = {
+ "azure-openai": "https://example-resource.openai.azure.com",
"bailian-coding-plan": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1",
"xiaomi-mimo": "https://token-plan-ams.xiaomimimo.com/v1",
"searxng-search": "http://localhost:8888/search",
@@ -5291,6 +5293,8 @@ function getProviderBaseUrlDefault(providerId?: string | null) {
function getProviderBaseUrlHint(providerId?: string | null) {
switch (providerId) {
+ case "azure-openai":
+ return "Required: paste your Azure OpenAI resource endpoint. OmniRoute will append /openai/deployments/{model}/chat/completions?api-version=....";
case "bailian-coding-plan":
return "Optional: Custom base URL for bailian-coding-plan provider";
case "xiaomi-mimo":
@@ -5310,6 +5314,8 @@ function getProviderBaseUrlHint(providerId?: string | null) {
function getProviderBaseUrlPlaceholder(providerId?: string | null) {
switch (providerId) {
+ case "azure-openai":
+ return "https://my-resource.openai.azure.com";
case "bailian-coding-plan":
case "xiaomi-mimo":
return getProviderBaseUrlDefault(providerId);
@@ -5379,7 +5385,7 @@ function AddApiKeyModal({
const t = useTranslations("providers");
const usesBaseUrl = CONFIGURABLE_BASE_URL_PROVIDERS.has(provider || "");
const defaultBaseUrl = getProviderBaseUrlDefault(provider);
- const isVertex = provider === "vertex";
+ const isVertex = provider === "vertex" || provider === "vertex-partner";
const defaultRegion = "us-central1";
const isGlm = provider === "glm" || provider === "glmt";
const isQoder = provider === "qoder";
@@ -5855,7 +5861,7 @@ function EditConnectionModal({ isOpen, connection, onSave, onClose }: EditConnec
const usesBaseUrl = CONFIGURABLE_BASE_URL_PROVIDERS.has(connection?.provider || "");
const defaultBaseUrl = getProviderBaseUrlDefault(connection?.provider);
- const isVertex = connection?.provider === "vertex";
+ const isVertex = connection?.provider === "vertex" || connection?.provider === "vertex-partner";
const isGlm = connection?.provider === "glm" || connection?.provider === "glmt";
const isCloudflare = connection?.provider === "cloudflare-ai";
const isCodex = connection?.provider === "codex";
diff --git a/src/app/(dashboard)/dashboard/settings/components/VisionBridgeSettingsTab.tsx b/src/app/(dashboard)/dashboard/settings/components/VisionBridgeSettingsTab.tsx
new file mode 100644
index 0000000000..3a5f65368f
--- /dev/null
+++ b/src/app/(dashboard)/dashboard/settings/components/VisionBridgeSettingsTab.tsx
@@ -0,0 +1,186 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { Card, Toggle } from "@/shared/components";
+import { VISION_BRIDGE_DEFAULTS } from "@/shared/constants/visionBridgeDefaults";
+
+type SettingsState = {
+ visionBridgeEnabled: boolean;
+ visionBridgeModel: string;
+ visionBridgePrompt: string;
+ visionBridgeTimeout: number;
+ visionBridgeMaxImages: number;
+};
+
+export default function VisionBridgeSettingsTab() {
+ const [settings, setSettings] = useState<SettingsState>({
+ visionBridgeEnabled: VISION_BRIDGE_DEFAULTS.enabled,
+ visionBridgeModel: VISION_BRIDGE_DEFAULTS.model,
+ visionBridgePrompt: VISION_BRIDGE_DEFAULTS.prompt,
+ visionBridgeTimeout: VISION_BRIDGE_DEFAULTS.timeoutMs,
+ visionBridgeMaxImages: VISION_BRIDGE_DEFAULTS.maxImagesPerRequest,
+ });
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ fetch("/api/settings")
+ .then((res) => (res.ok ? res.json() : null))
+ .then((data) => {
+ if (!data) return;
+ setSettings({
+ visionBridgeEnabled: data.visionBridgeEnabled ?? VISION_BRIDGE_DEFAULTS.enabled,
+ visionBridgeModel: data.visionBridgeModel ?? VISION_BRIDGE_DEFAULTS.model,
+ visionBridgePrompt: data.visionBridgePrompt ?? VISION_BRIDGE_DEFAULTS.prompt,
+ visionBridgeTimeout: data.visionBridgeTimeout ?? VISION_BRIDGE_DEFAULTS.timeoutMs,
+ visionBridgeMaxImages:
+ data.visionBridgeMaxImages ?? VISION_BRIDGE_DEFAULTS.maxImagesPerRequest,
+ });
+ })
+ .finally(() => setLoading(false));
+ }, []);
+
+ const updateSetting = async (patch: Partial<SettingsState>) => {
+ try {
+ const res = await fetch("/api/settings", {
+ method: "PATCH",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(patch),
+ });
+ if (res.ok) {
+ setSettings((prev) => ({ ...prev, ...patch }));
+ }
+ } catch (error) {
+ console.error("Failed to update Vision Bridge settings:", error);
+ }
+ };
+
+ return (
+ <Card>
+ <div className="flex items-center gap-3 mb-4">
+ <div className="p-2 rounded-lg bg-fuchsia-500/10 text-fuchsia-500">
+ <span className="material-symbols-outlined text-[20px]" aria-hidden="true">
+ image_search
+ </span>
+ </div>
+ <div>
+ <h3 className="text-lg font-semibold">Vision Bridge</h3>
+ <p className="text-sm text-text-muted">
+ Run an automatic vision-to-text fallback before routing image requests to text-only
+ models.
+ </p>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-4">
+ <div className="flex items-center justify-between gap-4">
+ <div>
+ <p className="font-medium">Enabled</p>
+ <p className="text-sm text-text-muted">
+ Toggle the pre-call bridge that replaces image parts with extracted text.
+ </p>
+ </div>
+ <Toggle
+ checked={settings.visionBridgeEnabled}
+ onChange={(checked) => updateSetting({ visionBridgeEnabled: checked })}
+ disabled={loading}
+ />
+ </div>
+
+ <div className="pt-4 border-t border-border space-y-4">
+ <div>
+ <label className="block text-sm font-medium mb-1">Bridge Model</label>
+ <input
+ type="text"
+ value={settings.visionBridgeModel}
+ onChange={(e) =>
+ setSettings((prev) => ({ ...prev, visionBridgeModel: e.target.value }))
+ }
+ onBlur={() => updateSetting({ visionBridgeModel: settings.visionBridgeModel.trim() })}
+ className="w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm"
+ placeholder="openai/gpt-4o-mini"
+ />
+ <p className="text-xs text-text-muted mt-1">
+ Any OmniRoute model ID that supports vision can be used here.
+ </p>
+ </div>
+
+ <div>
+ <label className="block text-sm font-medium mb-1">Bridge Prompt</label>
+ <textarea
+ value={settings.visionBridgePrompt}
+ onChange={(e) =>
+ setSettings((prev) => ({ ...prev, visionBridgePrompt: e.target.value }))
+ }
+ onBlur={() =>
+ updateSetting({ visionBridgePrompt: settings.visionBridgePrompt.trim() })
+ }
+ className="min-h-[100px] w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm"
+ placeholder="Describe this image concisely."
+ />
+ <p className="text-xs text-text-muted mt-1">
+ Sent to the vision model before the extracted description is injected back into the
+ original request.
+ </p>
+ </div>
+
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
+ <div>
+ <label className="block text-sm font-medium mb-1">Timeout (ms)</label>
+ <input
+ type="number"
+ min={1000}
+ max={300000}
+ value={settings.visionBridgeTimeout}
+ onChange={(e) =>
+ setSettings((prev) => ({
+ ...prev,
+ visionBridgeTimeout: Number.parseInt(e.target.value, 10) || 0,
+ }))
+ }
+ onBlur={() =>
+ updateSetting({
+ visionBridgeTimeout: Math.min(
+ 300000,
+ Math.max(
+ 1000,
+ settings.visionBridgeTimeout || VISION_BRIDGE_DEFAULTS.timeoutMs
+ )
+ ),
+ })
+ }
+ className="w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm"
+ />
+ </div>
+ <div>
+ <label className="block text-sm font-medium mb-1">Max Images Per Request</label>
+ <input
+ type="number"
+ min={1}
+ max={20}
+ value={settings.visionBridgeMaxImages}
+ onChange={(e) =>
+ setSettings((prev) => ({
+ ...prev,
+ visionBridgeMaxImages: Number.parseInt(e.target.value, 10) || 0,
+ }))
+ }
+ onBlur={() =>
+ updateSetting({
+ visionBridgeMaxImages: Math.min(
+ 20,
+ Math.max(
+ 1,
+ settings.visionBridgeMaxImages || VISION_BRIDGE_DEFAULTS.maxImagesPerRequest
+ )
+ ),
+ })
+ }
+ className="w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm"
+ />
+ </div>
+ </div>
+ </div>
+ </div>
+ </Card>
+ );
+}
diff --git a/src/app/(dashboard)/dashboard/settings/page.tsx b/src/app/(dashboard)/dashboard/settings/page.tsx
index ca3d97282a..cbec0d9576 100644
--- a/src/app/(dashboard)/dashboard/settings/page.tsx
+++ b/src/app/(dashboard)/dashboard/settings/page.tsx
@@ -21,6 +21,7 @@ import ModelsDevSyncTab from "./components/ModelsDevSyncTab";
import ResilienceTab from "./components/ResilienceTab";
import CliproxyapiSettingsTab from "./components/CliproxyapiSettingsTab";
import PayloadRulesTab from "./components/PayloadRulesTab";
+import VisionBridgeSettingsTab from "./components/VisionBridgeSettingsTab";
import ModelRoutingSection from "@/shared/components/ModelRoutingSection";
const tabs = [
@@ -93,6 +94,7 @@ export default function SettingsPage() {
{activeTab === "ai" && (
<div className="flex flex-col gap-6">
<ThinkingBudgetTab />
+ <VisionBridgeSettingsTab />
<SystemPromptTab />
<CacheSettingsTab />
<MemorySkillsTab />
diff --git a/src/app/api/logs/active/route.ts b/src/app/api/logs/active/route.ts
new file mode 100644
index 0000000000..6ba7187835
--- /dev/null
+++ b/src/app/api/logs/active/route.ts
@@ -0,0 +1,43 @@
+import { NextResponse } from "next/server";
+import { requireManagementAuth } from "@/lib/api/requireManagementAuth";
+import { getProviderConnections } from "@/lib/localDb";
+import { getPendingRequests } from "@/lib/usage/usageHistory";
+
+export async function GET(request: Request) {
+ const authError = await requireManagementAuth(request);
+ if (authError) return authError;
+
+ try {
+ const pending = getPendingRequests();
+ const connections = await getProviderConnections();
+ const connectionNames = new Map(
+ connections.map((connection: any) => [
+ connection.id,
+ connection.displayName || connection.name || connection.email || connection.id,
+ ])
+ );
+
+ const now = Date.now();
+ const activeRequests = Object.entries(pending.details || {})
+ .flatMap(([connectionId, models]) =>
+ Object.entries(models).map(([modelKey, detail]) => ({
+ modelKey,
+ model: detail.model,
+ provider: detail.provider,
+ connectionId,
+ account:
+ connectionNames.get(connectionId) || detail.connectionId || connectionId || "unknown",
+ startedAt: detail.startedAt,
+ runningTimeMs: Math.max(0, now - detail.startedAt),
+ count: pending.byAccount?.[connectionId]?.[modelKey] || 0,
+ }))
+ )
+ .filter((requestRow) => requestRow.count > 0)
+ .sort((a, b) => a.startedAt - b.startedAt);
+
+ return NextResponse.json({ activeRequests, count: activeRequests.length });
+ } catch (error) {
+ console.log("Error loading active requests:", error);
+ return NextResponse.json({ error: "Failed to load active requests" }, { status: 500 });
+ }
+}
diff --git a/src/app/api/providers/[id]/models/route.ts b/src/app/api/providers/[id]/models/route.ts
index c19bbb67ef..7b3852e988 100755
--- a/src/app/api/providers/[id]/models/route.ts
+++ b/src/app/api/providers/[id]/models/route.ts
@@ -438,6 +438,22 @@ const PROVIDER_MODELS_CONFIG: Record<string, ProviderModelsConfigEntry> = {
authPrefix: "Bearer ",
parseResponse: (data) => data.data || data.models || [],
},
+ "opencode-go": {
+ url: "https://opencode.ai/zen/go/v1/models",
+ method: "GET",
+ headers: { "Content-Type": "application/json" },
+ authHeader: "Authorization",
+ authPrefix: "Bearer ",
+ parseResponse: (data) => data.data || data.models || [],
+ },
+ "glm-cn": {
+ url: "https://open.bigmodel.cn/api/coding/paas/v4/models",
+ method: "GET",
+ headers: { "Content-Type": "application/json" },
+ authHeader: "Authorization",
+ authPrefix: "Bearer ",
+ parseResponse: (data) => data.data || data.models || [],
+ },
};
/**
diff --git a/src/lib/providers/validation.ts b/src/lib/providers/validation.ts
index d1af78a9b6..d1b1d308dd 100644
--- a/src/lib/providers/validation.ts
+++ b/src/lib/providers/validation.ts
@@ -31,6 +31,12 @@ function normalizeBaseUrl(baseUrl: string) {
return (baseUrl || "").trim().replace(/\/$/, "");
}
+function normalizeAzureOpenAIBaseUrl(baseUrl: string) {
+ return normalizeBaseUrl(baseUrl)
+ .replace(/\/openai$/i, "")
+ .replace(/\/openai\/deployments\/[^/]+\/chat\/completions.*$/i, "");
+}
+
function normalizeAnthropicBaseUrl(baseUrl: string) {
return stripAnthropicMessagesSuffix(baseUrl || "");
}
@@ -673,6 +679,108 @@ async function validateGigachatProvider({ apiKey, providerSpecificData = {} }: a
});
}
+async function validateAzureOpenAIProvider({ apiKey, providerSpecificData = {} }: any) {
+ const rawBaseUrl = normalizeBaseUrl(providerSpecificData.baseUrl);
+ if (!rawBaseUrl) {
+ return { valid: false, error: "Missing base URL" };
+ }
+
+ const baseUrl = normalizeAzureOpenAIBaseUrl(rawBaseUrl);
+ const apiVersion =
+ typeof providerSpecificData.validationApiVersion === "string" &&
+ providerSpecificData.validationApiVersion.trim()
+ ? providerSpecificData.validationApiVersion.trim()
+ : "2024-12-01-preview";
+ const headers = applyCustomUserAgent(
+ {
+ "Content-Type": "application/json",
+ "api-key": apiKey,
+ },
+ providerSpecificData
+ );
+ const encodedVersion = encodeURIComponent(apiVersion);
+
+ for (const probeUrl of [
+ `${baseUrl}/openai/deployments?api-version=${encodedVersion}`,
+ `${baseUrl}/openai/models?api-version=${encodedVersion}`,
+ ]) {
+ try {
+ const response = await validationRead(probeUrl, { method: "GET", headers });
+ if (response.ok) {
+ return { valid: true, error: null, method: "azure_probe" };
+ }
+ if (response.status === 401 || response.status === 403) {
+ return { valid: false, error: "Invalid API key" };
+ }
+ if (response.status === 400 || response.status === 404 || response.status === 405) {
+ continue;
+ }
+ if (response.status === 429) {
+ return {
+ valid: true,
+ error: null,
+ method: "azure_probe",
+ warning: "Rate limited, but credentials are valid",
+ };
+ }
+ if (response.status >= 500) {
+ return { valid: false, error: `Provider unavailable (${response.status})` };
+ }
+ } catch (error) {
+ return toValidationErrorResult(error);
+ }
+ }
+
+ const deploymentId =
+ typeof providerSpecificData.validationModelId === "string"
+ ? providerSpecificData.validationModelId.trim()
+ : "";
+
+ if (!deploymentId) {
+ return {
+ valid: true,
+ error: null,
+ warning:
+ "Azure key accepted, but no deployment name was provided for a chat probe. Set Model ID to validate a specific deployment.",
+ };
+ }
+
+ const chatUrl = `${baseUrl}/openai/deployments/${encodeURIComponent(deploymentId)}/chat/completions?api-version=${encodedVersion}`;
+ const response = await validationWrite(chatUrl, {
+ method: "POST",
+ headers,
+ body: JSON.stringify({
+ model: deploymentId,
+ messages: [{ role: "user", content: "test" }],
+ max_tokens: 1,
+ }),
+ });
+
+ if (
+ response.ok ||
+ response.status === 400 ||
+ response.status === 422 ||
+ response.status === 429
+ ) {
+ return { valid: true, error: null, method: "chat_probe" };
+ }
+ if (response.status === 401 || response.status === 403) {
+ return { valid: false, error: "Invalid API key" };
+ }
+ if (response.status === 404) {
+ return {
+ valid: true,
+ error: null,
+ method: "chat_probe",
+ warning: "Azure credentials are valid, but the requested deployment was not found.",
+ };
+ }
+ if (response.status >= 500) {
+ return { valid: false, error: `Provider unavailable (${response.status})` };
+ }
+ return { valid: false, error: `Validation failed: ${response.status}` };
+}
+
async function validateOpenAICompatibleProvider({ apiKey, providerSpecificData = {} }: any) {
const baseUrl = normalizeBaseUrl(providerSpecificData.baseUrl);
if (!baseUrl) {
@@ -1292,6 +1400,7 @@ export async function validateProviderApiKey({ provider, apiKey, providerSpecifi
gigachat: validateGigachatProvider,
"grok-web": validateGrokWebProvider,
"perplexity-web": validatePerplexityWebProvider,
+ "azure-openai": validateAzureOpenAIProvider,
vertex: async ({ apiKey }: any) => {
try {
const { parseSAFromApiKey, getAccessToken } =
@@ -1304,6 +1413,17 @@ export async function validateProviderApiKey({ provider, apiKey, providerSpecifi
return { valid: false, error: "Invalid Service Account JSON: " + error.message };
}
},
+ "vertex-partner": async ({ apiKey }: any) => {
+ try {
+ const { parseSAFromApiKey, getAccessToken } =
+ await import("@omniroute/open-sse/executors/vertex.ts");
+ const sa = parseSAFromApiKey(apiKey);
+ await getAccessToken(sa);
+ return { valid: true, error: null };
+ } catch (error: any) {
+ return { valid: false, error: "Invalid Service Account JSON: " + error.message };
+ }
+ },
// LongCat AI — does not expose /v1/models; validate via chat completions directly (#592)
longcat: async ({ apiKey, providerSpecificData }: any) => {
try {
diff --git a/src/lib/usage/usageHistory.ts b/src/lib/usage/usageHistory.ts
index afb56e2cb6..21814245a2 100644
--- a/src/lib/usage/usageHistory.ts
+++ b/src/lib/usage/usageHistory.ts
@@ -55,9 +55,33 @@ function stdDev(values: number[], avg: number): number {
const pendingRequests: {
byModel: Record<string, number>;
byAccount: Record<string, Record<string, number>>;
+ details: Record<
+ string,
+ Record<
+ string,
+ {
+ model: string;
+ provider: string;
+ connectionId: string | null;
+ startedAt: number;
+ }
+ >
+ >;
} = {
byModel: Object.create(null) as Record<string, number>,
byAccount: Object.create(null) as Record<string, Record<string, number>>,
+ details: Object.create(null) as Record<
+ string,
+ Record<
+ string,
+ {
+ model: string;
+ provider: string;
+ connectionId: string | null;
+ startedAt: number;
+ }
+ >
+ >,
};
/**
@@ -84,6 +108,17 @@ export function trackPendingRequest(
if (!Object.prototype.hasOwnProperty.call(pendingRequests.byAccount, connectionId)) {
pendingRequests.byAccount[connectionId] = Object.create(null) as Record<string, number>;
}
+ if (!Object.prototype.hasOwnProperty.call(pendingRequests.details, connectionId)) {
+ pendingRequests.details[connectionId] = Object.create(null) as Record<
+ string,
+ {
+ model: string;
+ provider: string;
+ connectionId: string | null;
+ startedAt: number;
+ }
+ >;
+ }
if (!Object.prototype.hasOwnProperty.call(pendingRequests.byAccount[connectionId], modelKey)) {
pendingRequests.byAccount[connectionId][modelKey] = 0;
}
@@ -91,6 +126,23 @@ export function trackPendingRequest(
0,
pendingRequests.byAccount[connectionId][modelKey] + (started ? 1 : -1)
);
+
+ const nextCount = pendingRequests.byAccount[connectionId][modelKey];
+ if (started && nextCount > 0) {
+ if (!pendingRequests.details[connectionId][modelKey]) {
+ pendingRequests.details[connectionId][modelKey] = {
+ model,
+ provider,
+ connectionId,
+ startedAt: Date.now(),
+ };
+ }
+ } else if (!started && nextCount === 0) {
+ delete pendingRequests.details[connectionId][modelKey];
+ if (Object.keys(pendingRequests.details[connectionId]).length === 0) {
+ delete pendingRequests.details[connectionId];
+ }
+ }
}
}
diff --git a/src/shared/components/ActiveRequestsPanel.tsx b/src/shared/components/ActiveRequestsPanel.tsx
new file mode 100644
index 0000000000..d8467c5a2b
--- /dev/null
+++ b/src/shared/components/ActiveRequestsPanel.tsx
@@ -0,0 +1,108 @@
+"use client";
+
+import { useEffect, useState } from "react";
+
+type ActiveRequestRow = {
+ model: string;
+ provider: string;
+ account: string;
+ startedAt: number;
+ runningTimeMs: number;
+ count: number;
+};
+
+function formatDuration(ms: number): string {
+ const totalSeconds = Math.max(0, Math.floor(ms / 1000));
+ const minutes = Math.floor(totalSeconds / 60);
+ const seconds = totalSeconds % 60;
+ if (minutes <= 0) return `${seconds}s`;
+ if (minutes < 60) return `${minutes}m ${seconds}s`;
+ const hours = Math.floor(minutes / 60);
+ return `${hours}h ${minutes % 60}m`;
+}
+
+export default function ActiveRequestsPanel() {
+ const [rows, setRows] = useState<ActiveRequestRow[]>([]);
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ let cancelled = false;
+
+ const load = async () => {
+ try {
+ const res = await fetch("/api/logs/active", { cache: "no-store" });
+ if (!res.ok) return;
+ const data = await res.json();
+ if (!cancelled) {
+ setRows(Array.isArray(data.activeRequests) ? data.activeRequests : []);
+ }
+ } catch (error) {
+ if (!cancelled) {
+ console.error("Failed to load active requests:", error);
+ }
+ } finally {
+ if (!cancelled) {
+ setLoading(false);
+ }
+ }
+ };
+
+ load();
+ const interval = setInterval(load, 3000);
+ return () => {
+ cancelled = true;
+ clearInterval(interval);
+ };
+ }, []);
+
+ if (!loading && rows.length === 0) {
+ return null;
+ }
+
+ return (
+ <div className="rounded-xl border border-border bg-card/70">
+ <div className="flex items-center justify-between gap-4 border-b border-border px-4 py-3">
+ <div>
+ <h3 className="text-sm font-semibold uppercase tracking-wide text-text-main">
+ Running Requests
+ </h3>
+ <p className="text-xs text-text-muted">
+ Requests that are still in flight across providers and accounts.
+ </p>
+ </div>
+ <div className="inline-flex items-center gap-2 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-3 py-1 text-xs font-medium text-emerald-300">
+ <span className="h-2 w-2 rounded-full bg-emerald-400 animate-pulse" />
+ {loading ? "Loading..." : `${rows.length} active`}
+ </div>
+ </div>
+
+ <div className="overflow-x-auto">
+ <table className="min-w-full text-sm">
+ <thead className="bg-sidebar/40 text-left text-xs uppercase tracking-wide text-text-muted">
+ <tr>
+ <th className="px-4 py-3 font-medium">Model</th>
+ <th className="px-4 py-3 font-medium">Provider</th>
+ <th className="px-4 py-3 font-medium">Account</th>
+ <th className="px-4 py-3 font-medium">Elapsed</th>
+ <th className="px-4 py-3 font-medium">Count</th>
+ </tr>
+ </thead>
+ <tbody>
+ {rows.map((row) => (
+ <tr
+ key={`${row.account}:${row.provider}:${row.model}:${row.startedAt}`}
+ className="border-t border-border/60"
+ >
+ <td className="px-4 py-3 font-medium text-text-main">{row.model}</td>
+ <td className="px-4 py-3 text-text-muted">{row.provider}</td>
+ <td className="px-4 py-3 text-text-muted">{row.account}</td>
+ <td className="px-4 py-3 text-text-main">{formatDuration(row.runningTimeMs)}</td>
+ <td className="px-4 py-3 text-text-main">{row.count}</td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ );
+}
diff --git a/src/shared/constants/cliTools.ts b/src/shared/constants/cliTools.ts
index b20daf31c0..a9069de213 100644
--- a/src/shared/constants/cliTools.ts
+++ b/src/shared/constants/cliTools.ts
@@ -287,6 +287,42 @@ export const CLI_TOOLS = {
]
}
}
+}`,
+ },
+ },
+ hermes: {
+ id: "hermes",
+ name: "Hermes",
+ icon: "terminal",
+ color: "#8B5CF6",
+ description: "Hermes coding agent quick configuration",
+ docsUrl: "/docs?section=cli-tools&tool=hermes",
+ configType: "guide",
+ defaultCommand: "hermes",
+ guideSteps: [
+ {
+ step: 1,
+ title: "Open Hermes Config",
+ desc: "Open your Hermes configuration file or create one if this is the first run.",
+ },
+ { step: 2, title: "API Key", type: "apiKeySelector" },
+ { step: 3, title: "Base URL", value: "{{baseUrl}}", copyable: true },
+ { step: 4, title: "Select Model", type: "modelSelector" },
+ {
+ step: 5,
+ title: "Save Provider Block",
+ desc: "Use the JSON block below as the OpenAI-compatible provider definition for OmniRoute.",
+ },
+ ],
+ codeBlock: {
+ language: "json",
+ code: `{
+ "provider": {
+ "type": "openai",
+ "baseURL": "{{baseUrl}}",
+ "apiKey": "{{apiKey}}",
+ "model": "{{model}}"
+ }
}`,
},
},
diff --git a/src/shared/constants/providers.ts b/src/shared/constants/providers.ts
index 26afcc2ebc..59ab666a6d 100644
--- a/src/shared/constants/providers.ts
+++ b/src/shared/constants/providers.ts
@@ -117,6 +117,15 @@ export const APIKEY_PROVIDERS = {
textIcon: "GL",
website: "https://open.bigmodel.cn",
},
+ "glm-cn": {
+ id: "glm-cn",
+ alias: "glmcn",
+ name: "GLM Coding (China)",
+ icon: "code",
+ color: "#DC2626",
+ textIcon: "GC",
+ website: "https://open.bigmodel.cn",
+ },
glmt: {
id: "glmt",
alias: "glmt",
@@ -199,6 +208,18 @@ export const APIKEY_PROVIDERS = {
textIcon: "OA",
website: "https://platform.openai.com",
},
+ "azure-openai": {
+ id: "azure-openai",
+ alias: "azure",
+ name: "Azure OpenAI",
+ icon: "cloud",
+ color: "#0078D4",
+ textIcon: "AZ",
+ website: "https://azure.microsoft.com/products/ai-services/openai-service",
+ authHint:
+ "Use your Azure OpenAI API key. Base URL should be your resource endpoint, for example https://my-resource.openai.azure.com.",
+ passthroughModels: true,
+ },
anthropic: {
id: "anthropic",
alias: "anthropic",
@@ -441,6 +462,16 @@ export const APIKEY_PROVIDERS = {
website: "https://cloud.google.com/vertex-ai",
authHint: "Provide Service Account JSON or OAuth access_token",
},
+ "vertex-partner": {
+ id: "vertex-partner",
+ alias: "vp",
+ name: "Vertex AI Partners",
+ icon: "cloud",
+ color: "#34A853",
+ textIcon: "VP",
+ website: "https://cloud.google.com/vertex-ai",
+ authHint: "Provide the same Service Account JSON used for Vertex AI partner models.",
+ },
zai: {
id: "zai",
alias: "zai",
diff --git a/src/shared/services/cliRuntime.ts b/src/shared/services/cliRuntime.ts
index ac49712a76..cf021d9e8c 100644
--- a/src/shared/services/cliRuntime.ts
+++ b/src/shared/services/cliRuntime.ts
@@ -110,6 +110,15 @@ const CLI_TOOLS: Record<string, any> = {
config: ".config/opencode/opencode.json",
},
},
+ hermes: {
+ defaultCommand: "hermes",
+ envBinKey: "CLI_HERMES_BIN",
+ requiresBinary: false,
+ healthcheckTimeoutMs: 4000,
+ paths: {
+ config: ".config/hermes/config.json",
+ },
+ },
amp: {
defaultCommand: "amp",
envBinKey: "CLI_AMP_BIN",
diff --git a/src/shared/validation/settingsSchemas.ts b/src/shared/validation/settingsSchemas.ts
index 1672ad4579..2222432771 100644
--- a/src/shared/validation/settingsSchemas.ts
+++ b/src/shared/validation/settingsSchemas.ts
@@ -97,6 +97,12 @@ export const updateSettingsSchema = z.object({
// models.dev sync settings
modelsDevSyncEnabled: z.boolean().optional(),
modelsDevSyncInterval: z.number().int().min(3600000).max(604800000).optional(),
+ // Vision Bridge settings
+ visionBridgeEnabled: z.boolean().optional(),
+ visionBridgeModel: z.string().max(200).optional(),
+ visionBridgePrompt: z.string().max(5000).optional(),
+ visionBridgeTimeout: z.number().int().min(1000).max(300000).optional(),
+ visionBridgeMaxImages: z.number().int().min(1).max(20).optional(),
// Missing settings
lkgpEnabled: z.boolean().optional(),
backgroundDegradation: z.unknown().optional(),
diff --git a/tests/unit/azure-openai-executor.test.ts b/tests/unit/azure-openai-executor.test.ts
new file mode 100644
index 0000000000..44452e6b4e
--- /dev/null
+++ b/tests/unit/azure-openai-executor.test.ts
@@ -0,0 +1,44 @@
+import test from "node:test";
+import assert from "node:assert/strict";
+
+import { AzureOpenAIExecutor } from "../../open-sse/executors/azure-openai.ts";
+
+test("AzureOpenAIExecutor builds deployment-based chat URLs from the resource endpoint", () => {
+ const executor = new AzureOpenAIExecutor();
+ const url = executor.buildUrl("my-gpt4o-deployment", true, 0, {
+ providerSpecificData: {
+ baseUrl: "https://my-resource.openai.azure.com",
+ },
+ });
+
+ assert.equal(
+ url,
+ "https://my-resource.openai.azure.com/openai/deployments/my-gpt4o-deployment/chat/completions?api-version=2024-12-01-preview"
+ );
+});
+
+test("AzureOpenAIExecutor strips duplicated /openai suffixes from configured base URLs", () => {
+ const executor = new AzureOpenAIExecutor();
+ const url = executor.buildUrl("deploy-1", false, 0, {
+ providerSpecificData: {
+ baseUrl: "https://my-resource.openai.azure.com/openai/",
+ apiVersion: "2025-01-01-preview",
+ },
+ });
+
+ assert.equal(
+ url,
+ "https://my-resource.openai.azure.com/openai/deployments/deploy-1/chat/completions?api-version=2025-01-01-preview"
+ );
+});
+
+test("AzureOpenAIExecutor uses api-key auth headers instead of Bearer auth", () => {
+ const executor = new AzureOpenAIExecutor();
+ const headers = executor.buildHeaders({ apiKey: "azure-key-123" }, true);
+
+ assert.deepEqual(headers, {
+ "Content-Type": "application/json",
+ "api-key": "azure-key-123",
+ Accept: "text/event-stream",
+ });
+});
diff --git a/tests/unit/cli-tools.test.ts b/tests/unit/cli-tools.test.ts
index ae2f7e1ff6..a0964706c2 100644
--- a/tests/unit/cli-tools.test.ts
+++ b/tests/unit/cli-tools.test.ts
@@ -27,3 +27,13 @@ test("Amp CLI is discoverable in runtime tooling but excluded from provider fing
assert.ok(CLI_TOOL_IDS.includes("amp"));
assert.equal(CLI_COMPAT_PROVIDER_IDS.includes("amp"), false);
});
+
+test("Hermes quick-config is registered as a guide-based CLI tool", () => {
+ const hermes = CLI_TOOLS.hermes;
+ assert.ok(hermes);
+ assert.equal(hermes.configType, "guide");
+ assert.equal(hermes.defaultCommand, "hermes");
+ assert.ok(Array.isArray(hermes.guideSteps));
+ assert.ok(String(hermes.codeBlock?.code || "").includes('"baseURL": "{{baseUrl}}"'));
+ assert.ok(CLI_TOOL_IDS.includes("hermes"));
+});
diff --git a/tests/unit/model-strip.test.ts b/tests/unit/model-strip.test.ts
new file mode 100644
index 0000000000..05c99cbb57
--- /dev/null
+++ b/tests/unit/model-strip.test.ts
@@ -0,0 +1,48 @@
+import test from "node:test";
+import assert from "node:assert/strict";
+
+import {
+ getStripTypesForProviderModel,
+ stripIncompatibleMessageContent,
+} from "../../open-sse/services/modelStrip.ts";
+
+test("model strip metadata is exposed for text-only models", () => {
+ assert.deepEqual(getStripTypesForProviderModel("deepseek", "deepseek-chat"), ["image", "audio"]);
+ assert.deepEqual(getStripTypesForProviderModel("bailian-coding-plan", "qwen3-coder-next"), [
+ "image",
+ "audio",
+ ]);
+ assert.deepEqual(getStripTypesForProviderModel("openai", "gpt-4o"), []);
+});
+
+test("stripIncompatibleMessageContent removes image and audio parts but preserves text", () => {
+ const originalMessages = [
+ {
+ role: "user",
+ content: [
+ { type: "text", text: "Summarize this input." },
+ { type: "image_url", image_url: { url: "https://example.com/image.png" } },
+ { type: "input_audio", input_audio: { data: "abc", format: "wav" } },
+ ],
+ },
+ ];
+
+ const result = stripIncompatibleMessageContent(originalMessages, ["image", "audio"]);
+
+ assert.equal(result.removedParts, 2);
+ assert.deepEqual(result.messages, [
+ {
+ role: "user",
+ content: [{ type: "text", text: "Summarize this input." }],
+ },
+ ]);
+});
+
+test("stripIncompatibleMessageContent leaves non-array content untouched", () => {
+ const originalMessages = [{ role: "user", content: "hello" }];
+
+ const result = stripIncompatibleMessageContent(originalMessages, ["image"]);
+
+ assert.equal(result.removedParts, 0);
+ assert.deepEqual(result.messages, originalMessages);
+});
diff --git a/tests/unit/provider-validation-azure-vertex.test.ts b/tests/unit/provider-validation-azure-vertex.test.ts
new file mode 100644
index 0000000000..efed885d29
--- /dev/null
+++ b/tests/unit/provider-validation-azure-vertex.test.ts
@@ -0,0 +1,40 @@
+import test from "node:test";
+import assert from "node:assert/strict";
+
+const { validateProviderApiKey } = await import("../../src/lib/providers/validation.ts");
+
+const originalFetch = globalThis.fetch;
+
+test.afterEach(() => {
+ globalThis.fetch = originalFetch;
+});
+
+test("azure-openai validation accepts a successful deployments probe", async () => {
+ globalThis.fetch = async (url, init = {}) => {
+ assert.equal(
+ String(url),
+ "https://my-resource.openai.azure.com/openai/deployments?api-version=2024-12-01-preview"
+ );
+ assert.equal((init.headers as Record<string, string>)["api-key"], "azure-key");
+ return new Response(JSON.stringify({ data: [] }), { status: 200 });
+ };
+
+ const result = await validateProviderApiKey({
+ provider: "azure-openai",
+ apiKey: "azure-key",
+ providerSpecificData: { baseUrl: "https://my-resource.openai.azure.com" },
+ });
+
+ assert.equal(result.valid, true);
+ assert.equal(result.method, "azure_probe");
+});
+
+test("vertex-partner validation reuses the Vertex service account branch", async () => {
+ const invalid = await validateProviderApiKey({
+ provider: "vertex-partner",
+ apiKey: "not-json",
+ });
+
+ assert.equal(invalid.valid, false);
+ assert.match(invalid.error || "", /Invalid Service Account JSON/i);
+});
diff --git a/tests/unit/t20-t22-provider-headers.test.ts b/tests/unit/t20-t22-provider-headers.test.ts
index 56d333c6ad..2df405816a 100644
--- a/tests/unit/t20-t22-provider-headers.test.ts
+++ b/tests/unit/t20-t22-provider-headers.test.ts
@@ -2,7 +2,8 @@ import test from "node:test";
import assert from "node:assert/strict";
const { REGISTRY } = await import("../../open-sse/config/providerRegistry.ts");
-const { antigravityUserAgent } = await import("../../open-sse/services/antigravityHeaders.ts");
+const { antigravityUserAgent, geminiCLIUserAgent, GEMINI_CLI_VERSION } =
+ await import("../../open-sse/services/antigravityHeaders.ts");
test("T20: antigravity config has updated User-Agent and sandbox fallback URL", () => {
const antigravity = REGISTRY.antigravity;
@@ -13,6 +14,23 @@ test("T20: antigravity config has updated User-Agent and sandbox fallback URL",
assert.equal(antigravity.headers["User-Agent"], antigravityUserAgent());
});
+test("T20: gemini CLI fingerprint uses 0.31.0 and preserves darwin platform name", () => {
+ assert.equal(GEMINI_CLI_VERSION, "0.31.0");
+
+ const descriptor = Object.getOwnPropertyDescriptor(process, "platform");
+ Object.defineProperty(process, "platform", { value: "darwin" });
+ try {
+ assert.match(
+ geminiCLIUserAgent("gemini-3-flash"),
+ /^GeminiCLI\/0\.31\.0\/gemini-3-flash \(darwin; /
+ );
+ } finally {
+ if (descriptor) {
+ Object.defineProperty(process, "platform", descriptor);
+ }
+ }
+});
+
test("T25: anthropic API-key config includes the full Anthropic beta header set", () => {
const anthropic = REGISTRY.anthropic;
assert.equal(anthropic.headers["Anthropic-Version"], "2023-06-01");
diff --git a/tests/unit/t28-model-catalog-updates.test.ts b/tests/unit/t28-model-catalog-updates.test.ts
index 26dd23f454..787d99adb6 100644
--- a/tests/unit/t28-model-catalog-updates.test.ts
+++ b/tests/unit/t28-model-catalog-updates.test.ts
@@ -56,6 +56,15 @@ test("T28: vertex catalog includes partner models when vertex executor is availa
assert.ok(vertexIds.includes("glm-5"));
});
+test("T23/#1491: dedicated partner providers and opencode-go discovery metadata are registered", () => {
+ assert.equal(
+ REGISTRY["glm-cn"].baseUrl,
+ "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions"
+ );
+ assert.equal(REGISTRY["vertex-partner"].executor, "vertex");
+ assert.equal(REGISTRY["opencode-go"].modelsUrl, "https://opencode.ai/zen/go/v1/models");
+});
+
test("T28: new catalog models resolve through getModelInfoCore", async () => {
const minimax = await getModelInfoCore("minimax/minimax-m2.7", {});
assert.equal(minimax.provider, "minimax");
diff --git a/tests/unit/vision-bridge-settings-schema.test.ts b/tests/unit/vision-bridge-settings-schema.test.ts
new file mode 100644
index 0000000000..65c123b30a
--- /dev/null
+++ b/tests/unit/vision-bridge-settings-schema.test.ts
@@ -0,0 +1,25 @@
+import test from "node:test";
+import assert from "node:assert/strict";
+
+import { updateSettingsSchema } from "../../src/shared/validation/settingsSchemas.ts";
+
+test("Vision Bridge settings are accepted by the settings PATCH schema", () => {
+ const validation = updateSettingsSchema.safeParse({
+ visionBridgeEnabled: true,
+ visionBridgeModel: "openai/gpt-4o-mini",
+ visionBridgePrompt: "Describe the image contents briefly.",
+ visionBridgeTimeout: 45000,
+ visionBridgeMaxImages: 6,
+ });
+
+ assert.equal(validation.success, true);
+});
+
+test("Vision Bridge settings keep numeric bounds enforced", () => {
+ const validation = updateSettingsSchema.safeParse({
+ visionBridgeTimeout: 999999,
+ visionBridgeMaxImages: 0,
+ });
+
+ assert.equal(validation.success, false);
+});